This commit is contained in:
@@ -404,13 +404,27 @@ namespace AyaNova
|
||||
//TESTING
|
||||
if (TESTING_REFRESH_DB)
|
||||
{
|
||||
AyaNova.Core.License.Fetch(apiServerState, dbContext, _log);
|
||||
Util.Seeder.SeedDatabase(Util.Seeder.SeedLevel.HugeForLoadTest);
|
||||
AyaNova.Core.License.Fetch(apiServerState, dbContext, _log);
|
||||
Util.Seeder.SeedDatabase(Util.Seeder.SeedLevel.SmallOneManShopTrialDataSet);
|
||||
}
|
||||
//TESTING
|
||||
#endif
|
||||
|
||||
|
||||
//TEST AUTOID
|
||||
//Note that seeder may init this already in which case this code doesn't even need to run
|
||||
if (ServerBootConfig.WIDGET_SERIAL == null)
|
||||
{
|
||||
//query for most recently used serial number
|
||||
//(note, can't query for highest serial as it can and likely will reset or be changed manually from time to time
|
||||
// so the algorithm is to keep the most recent sequence going on startup of the server)
|
||||
var MostRecentWidget = dbContext.Widget.AsNoTracking().OrderByDescending(x => x.Id).FirstOrDefault();
|
||||
uint MaxWidgetId = 0;
|
||||
if (MostRecentWidget != null)
|
||||
MaxWidgetId = MostRecentWidget.Serial;
|
||||
ServerBootConfig.WIDGET_SERIAL = new AutoId(MaxWidgetId);
|
||||
}
|
||||
|
||||
//Open up the server for visitors
|
||||
apiServerState.SetOpen();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user