This commit is contained in:
2023-01-13 01:09:05 +00:00
parent 5ba5b65a5d
commit 650ae96987
22 changed files with 268 additions and 42 deletions

View File

@@ -132,6 +132,14 @@ namespace Sockeye.Biz
public async Task ImportRockfish(AyContext ct, ILogger log)
{
log.LogInformation("Start import from rockfish, authenticating");
ApiServerState apiServerState = (ApiServerState)ServiceProviderProvider.Provider.GetService(typeof(ApiServerState));
//get the current server state so can set back to it later
ApiServerState.ServerState wasServerState = apiServerState.GetState();
string wasReason = apiServerState.Reason;
apiServerState.SetOpsOnly("Migrating from Rockfish");
ServerBootConfig.MIGRATING = true;
//Authenticate to rockfish
//string sUrl = $"{LICENSE_SERVER_URL_ROCKFISH}rvr";
string URL_ROCKFISH = "https://rockfish.ayanova.com/";
@@ -766,6 +774,12 @@ namespace Sockeye.Biz
var msg = "*** RockFish import FAILED ***";
log.LogError(ex, msg);
}
finally
{
ServerBootConfig.MIGRATING = false;
log.LogInformation($"Migrate Rockfish: setting server state back to {wasServerState.ToString()}");
apiServerState.SetState(wasServerState, wasReason);
}