This commit is contained in:
@@ -422,24 +422,24 @@ namespace AyaNova
|
|||||||
if (ServerBootConfig.AYANOVA_PERMANENTLY_ERASE_DATABASE)
|
if (ServerBootConfig.AYANOVA_PERMANENTLY_ERASE_DATABASE)
|
||||||
{
|
{
|
||||||
_newLog.LogWarning("BOOT: AYANOVA_PERMANENTLY_ERASE_DATABASE is true, dropping and recreating database");
|
_newLog.LogWarning("BOOT: AYANOVA_PERMANENTLY_ERASE_DATABASE is true, dropping and recreating database");
|
||||||
Util.DbUtil.DropAndRecreateDbAsync(_newLog);
|
Util.DbUtil.DropAndRecreateDbAsync(_newLog).Wait();
|
||||||
AySchema.CheckAndUpdateAsync(dbContext, _newLog);
|
AySchema.CheckAndUpdateAsync(dbContext, _newLog).Wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check schema
|
//Check schema
|
||||||
_newLog.LogDebug("BOOT: db schema check");
|
_newLog.LogDebug("BOOT: db schema check");
|
||||||
AySchema.CheckAndUpdateAsync(dbContext, _newLog);
|
AySchema.CheckAndUpdateAsync(dbContext, _newLog).Wait();
|
||||||
|
|
||||||
//Check database integrity
|
//Check database integrity
|
||||||
_newLog.LogDebug("BOOT: db integrity check");
|
_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
|
//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
|
//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);
|
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
|
//TESTING
|
||||||
if (TESTING_REFRESH_DB)
|
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
|
//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
|
//TESTING
|
||||||
#endif
|
#endif
|
||||||
@@ -475,7 +475,7 @@ namespace AyaNova
|
|||||||
|
|
||||||
|
|
||||||
//Log the active user count so it's in the log record
|
//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
|
//Log the license info so it's on the record
|
||||||
_newLog.LogInformation($"BOOT: License -\r\n=-=-=-=-=-=-=-=-=-=-\r\n{AyaNova.Core.License.LicenseInfo}=-=-=-=-=-=-=-=-=-=-");
|
_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);
|
JObject jobData = JObject.Parse(job.JobInfo);
|
||||||
var seedLevel = (Seeder.SeedLevel)jobData["seedLevel"].Value<int>();
|
var seedLevel = (Seeder.SeedLevel)jobData["seedLevel"].Value<int>();
|
||||||
var timeZoneOffset = jobData["timeZoneOffset"].Value<decimal>();
|
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.LogJobAsync(job.GId, "Finished.", ct);
|
||||||
await JobsBiz.UpdateJobStatusAsync(job.GId, JobStatus.Completed, ct);
|
await JobsBiz.UpdateJobStatusAsync(job.GId, JobStatus.Completed, ct);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user