From 7a21ff6714fa48d3419b5c2650dd1a5a10326c29 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 27 Aug 2021 18:40:48 +0000 Subject: [PATCH] --- source/Plugins/AyaNova.Plugin.V8/V8.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index 1b393f9..bdc3219 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -390,10 +390,15 @@ namespace AyaNova.PlugIn.V8 progress.StartedImport(); progress.Append("Exporting data to AyaNova server @ " + util.ApiBaseUrl); progress.Append(util.PRE_RELEASE_VERSION_STRING); + Exception ExceptionDuringMigrate = null; try { progress.Op("Preparing to export...."); + //MIGRATE MODE + progress.Append("Setting v8 Server State to 'Migrate Mode'"); + await util.PostAsync("server-state", "{\"serverState\":\"MigrateMode\"}"); + ResetUniqueUserNames(); ResetUniqueNames(); Allv8WarehouseIds.Clear(); @@ -409,18 +414,19 @@ namespace AyaNova.PlugIn.V8 //admin user (not exported but is there already) V7ToV8IdMap.Add(User.AdministratorID, 1); - //MIGRATE MODE - progress.Append("Setting v8 Server State to 'Migrate Mode'"); - await util.PostAsync("server-state", "{\"serverState\":\"MigrateMode\"}"); + + //ERASE DB progress.Append("Erasing AyaNova 8 data"); + //delay to allow migrate mode to take effect + //this is a result of pm's generating in a loop at server causing issues with erasure + //this delay should not need to be more time than it takes for a single PM to generate into a workorder + //as of this time it's the only slow thing affecting migrate mode settling in + await System.Threading.Tasks.Task.Delay(7000); var a = await util.PostAsync("license/permanently-erase-all-data", "\"I understand\""); - //delay to allow event log to properly show erase as the first operation - // System.Threading.Thread.Sleep(2000); - //TAGS progress.Op("Compiling tags");