This commit is contained in:
@@ -422,24 +422,24 @@ namespace AyaNova
|
||||
if (ServerBootConfig.AYANOVA_PERMANENTLY_ERASE_DATABASE)
|
||||
{
|
||||
_newLog.LogWarning("BOOT: AYANOVA_PERMANENTLY_ERASE_DATABASE is true, dropping and recreating database");
|
||||
Util.DbUtil.DropAndRecreateDbAsync(_newLog);
|
||||
AySchema.CheckAndUpdateAsync(dbContext, _newLog);
|
||||
Util.DbUtil.DropAndRecreateDbAsync(_newLog).Wait();
|
||||
AySchema.CheckAndUpdateAsync(dbContext, _newLog).Wait();
|
||||
}
|
||||
|
||||
//Check schema
|
||||
_newLog.LogDebug("BOOT: db schema check");
|
||||
AySchema.CheckAndUpdateAsync(dbContext, _newLog);
|
||||
AySchema.CheckAndUpdateAsync(dbContext, _newLog).Wait();
|
||||
|
||||
//Check database integrity
|
||||
_newLog.LogDebug("BOOT: db integrity check");
|
||||
DbUtil.CheckFingerPrintAsync(AySchema.EXPECTED_COLUMN_COUNT, AySchema.EXPECTED_INDEX_COUNT, _newLog);
|
||||
DbUtil.CheckFingerPrintAsync(AySchema.EXPECTED_COLUMN_COUNT, AySchema.EXPECTED_INDEX_COUNT, _newLog).Wait();
|
||||
|
||||
//Initialize license
|
||||
AyaNova.Core.License.InitializeAsync(apiServerState, dbContext, _newLog);
|
||||
AyaNova.Core.License.InitializeAsync(apiServerState, dbContext, _newLog).Wait();
|
||||
|
||||
//Ensure locales are present, not missing any keys and that there is a server default locale that exists
|
||||
LocaleBiz lb = new LocaleBiz(dbContext, 1, ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID, AuthorizationRoles.OpsAdminFull);
|
||||
lb.ValidateLocalesAsync();
|
||||
lb.ValidateLocalesAsync().Wait();
|
||||
|
||||
|
||||
|
||||
@@ -447,9 +447,9 @@ namespace AyaNova
|
||||
//TESTING
|
||||
if (TESTING_REFRESH_DB)
|
||||
{
|
||||
AyaNova.Core.License.FetchKeyAsync(apiServerState, dbContext, _newLog);
|
||||
AyaNova.Core.License.FetchKeyAsync(apiServerState, dbContext, _newLog).Wait();
|
||||
//NOTE: For unit testing make sure the time zone in util is set to the same figure as here to ensure list filter by date tests will work because server is on same page as user in terms of time
|
||||
Util.Seeder.SeedDatabase(Util.Seeder.SeedLevel.SmallOneManShopTrialDataSet, -7);//#############################################################################################
|
||||
Util.Seeder.SeedDatabaseAsync(Util.Seeder.SeedLevel.SmallOneManShopTrialDataSet, -7).Wait();//#############################################################################################
|
||||
}
|
||||
//TESTING
|
||||
#endif
|
||||
@@ -475,7 +475,7 @@ namespace AyaNova
|
||||
|
||||
|
||||
//Log the active user count so it's in the log record
|
||||
_newLog.LogInformation($"BOOT: Active techs - {UserBiz.ActiveCount}");
|
||||
_newLog.LogInformation($"BOOT: Active techs - {UserBiz.ActiveCountAsync().Result}");
|
||||
|
||||
//Log the license info so it's on the record
|
||||
_newLog.LogInformation($"BOOT: License -\r\n=-=-=-=-=-=-=-=-=-=-\r\n{AyaNova.Core.License.LicenseInfo}=-=-=-=-=-=-=-=-=-=-");
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace AyaNova.Biz
|
||||
JObject jobData = JObject.Parse(job.JobInfo);
|
||||
var seedLevel = (Seeder.SeedLevel)jobData["seedLevel"].Value<int>();
|
||||
var timeZoneOffset = jobData["timeZoneOffset"].Value<decimal>();
|
||||
Seeder.SeedDatabaseAsync(seedLevel, job.GId, timeZoneOffset);
|
||||
await Seeder.SeedDatabaseAsync(seedLevel, job.GId, timeZoneOffset);
|
||||
await JobsBiz.LogJobAsync(job.GId, "Finished.", ct);
|
||||
await JobsBiz.UpdateJobStatusAsync(job.GId, JobStatus.Completed, ct);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user