From 080a3dfed7aa26d002da7fad2501482f61a8af3f Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 27 Jan 2020 23:39:12 +0000 Subject: [PATCH] --- server/AyaNova/Startup.cs | 18 +++++++++--------- server/AyaNova/biz/TrialBiz.cs | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/server/AyaNova/Startup.cs b/server/AyaNova/Startup.cs index eb68f5b6..2daa1862 100644 --- a/server/AyaNova/Startup.cs +++ b/server/AyaNova/Startup.cs @@ -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}=-=-=-=-=-=-=-=-=-=-"); diff --git a/server/AyaNova/biz/TrialBiz.cs b/server/AyaNova/biz/TrialBiz.cs index f47d3863..50ab95c5 100644 --- a/server/AyaNova/biz/TrialBiz.cs +++ b/server/AyaNova/biz/TrialBiz.cs @@ -71,7 +71,7 @@ namespace AyaNova.Biz JObject jobData = JObject.Parse(job.JobInfo); var seedLevel = (Seeder.SeedLevel)jobData["seedLevel"].Value(); var timeZoneOffset = jobData["timeZoneOffset"].Value(); - 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); }