mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 11:06:30 +00:00
make python app load a bit eariler, making startup a bit faster
This commit is contained in:
@@ -33,7 +33,7 @@ public partial class App
|
||||
private IMediator _mediator = null!;
|
||||
private FormState _formState = null!;
|
||||
|
||||
private PythonResourceLoader _resourceLoader = null!;
|
||||
private readonly PythonResourceLoader _resourceLoader = new();
|
||||
private Stream _securedConfig = null!;
|
||||
|
||||
private void OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
|
||||
@@ -54,7 +54,7 @@ public partial class App
|
||||
"Azaion.Dataset"
|
||||
];
|
||||
|
||||
private ApiConfig ReadConfig()
|
||||
private static ApiConfig ReadConfig()
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -69,8 +69,9 @@ public partial class App
|
||||
return new ApiConfig
|
||||
{
|
||||
Url = SecurityConstants.DEFAULT_API_URL,
|
||||
RetryCount = SecurityConstants.DEFAULT_API_RETRY_COUNT ,
|
||||
TimeoutSeconds = SecurityConstants.DEFAULT_API_TIMEOUT_SECONDS
|
||||
RetryCount = SecurityConstants.DEFAULT_API_RETRY_COUNT,
|
||||
TimeoutSeconds = SecurityConstants.DEFAULT_API_TIMEOUT_SECONDS,
|
||||
ResourcesFolder = ""
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -81,10 +82,9 @@ public partial class App
|
||||
var login = new Login();
|
||||
login.CredentialsEntered += (_, credentials) =>
|
||||
{
|
||||
var apiConfig = ReadConfig();
|
||||
var api = AzaionApiClient.Create(credentials, apiConfig);
|
||||
|
||||
_resourceLoader = new PythonResourceLoader(apiConfig, credentials, api);
|
||||
var config = ReadConfig();
|
||||
credentials.Folder = config.ResourcesFolder;
|
||||
_resourceLoader.Login(credentials);
|
||||
_securedConfig = _resourceLoader.LoadFileFromPython("secured-config.json");
|
||||
|
||||
AppDomain.CurrentDomain.AssemblyResolve += (_, a) =>
|
||||
|
||||
Reference in New Issue
Block a user