/// <summary> /// This is the main entry point for your service replica. /// This method executes when this replica of your service becomes primary and has write status. /// </summary> /// <param name="cancellationToken">Canceled when Service Fabric needs to shut down this service replica.</param> protected override async Task RunAsync(CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); try { InitializeReliableCollections(); string debugMessage = $"{baseLogString} RunAsync => ReliableDictionaries initialized."; Logger.LogDebug(debugMessage); await modelProvider.ImportDataInCache(); } catch (Exception e) { string errorMessage = $"{baseLogString} RunAsync => Exception caught: {e.Message}."; Logger.LogInformation(errorMessage, e); } }
/// <summary> /// This is the main entry point for your service replica. /// This method executes when this replica of your service becomes primary and has write status. /// </summary> /// <param name="cancellationToken">Canceled when Service Fabric needs to shut down this service replica.</param> protected override async Task RunAsync(CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); try { InitializeReliableCollections(); string debugMessage = $"{baseLogString} RunAsync => ReliableDictionaries initialized."; Logger.LogDebug(debugMessage); ServiceEventSource.Current.ServiceMessage(this.Context, $"[ModelProviderService | Information] {debugMessage}"); await modelProvider.ImportDataInCache(); } catch (Exception e) { string errorMessage = $"{baseLogString} RunAsync => Exception caught: {e.Message}."; Logger.LogInformation(errorMessage, e); ServiceEventSource.Current.ServiceMessage(this.Context, $"[ModelProviderService | Error] {errorMessage}"); } }