Exemple #1
0
        public async Task ReloadIfNeededAsync()
        {
            LastCompletedExecutionDocument lastCompletedExecution = await _readOnlyMongoDbService.GetSingleDocumentAsync <LastCompletedExecutionDocument>();

            if (lastCompletedExecution == null || (DateTime.UtcNow - lastCompletedExecution.LastCompletedExecution).Hours >= _internalComConfiguration.HoursToForce)
            {
                HttpClient client = new HttpClient();
                Console.WriteLine(_internalComConfiguration.ForceSyncUrl);
                await client.PostAsync(_internalComConfiguration.ForceSyncUrl, new StringContent(string.Empty));
            }
        }