Skip to main content
added 6 characters in body
Source Link
 private readonly SemaphoreSlim _mutex = new SemaphoreSlim(1); public async Task ProcessPostedCommandsAsync() { using (var showContext = new ShowContext()) { var retryCnt = 0; var maxRetries = 8; var commands = FindCommands(showContext); foreach (var command in commands) { await _mutex.WaitAsync(); try { // read data from the cloud, // based on data from the cloud, write back to the cloud // mark the command as processed in the database await ProcessCommandAsync(showContext, command); } catch (Exception e) { GlobalLogger.Logger.Error(e, $"assinging executing task, Exception in Process Commands pkid = {command.Pkid} "); GlobalLogger.Logger.Error($"Retry count = {retryCnt}"); retryCnt++; await Task.Delay(2000); if (retryCnt == maxRetries) { break; // from for } } finally { _mutex.Release(); } } } } 
 private readonly SemaphoreSlim _mutex = new SemaphoreSlim(1); public async Task ProcessPostedCommandsAsync() { using (var showContext = new ShowContext()) { var retryCnt = 0; var maxRetries = 8; var commands = FindCommands(showContext); foreach (var command in commands) { await _mutex.WaitAsync(); try { // read data from the cloud, // based on data from the cloud, write back to the cloud // mark the command as processed in the database ProcessCommandAsync(showContext, command); } catch (Exception e) { GlobalLogger.Logger.Error(e, $"assinging executing task, Exception in Process Commands pkid = {command.Pkid} "); GlobalLogger.Logger.Error($"Retry count = {retryCnt}"); retryCnt++; await Task.Delay(2000); if (retryCnt == maxRetries) { break; // from for } } finally { _mutex.Release(); } } } } 
 private readonly SemaphoreSlim _mutex = new SemaphoreSlim(1); public async Task ProcessPostedCommandsAsync() { using (var showContext = new ShowContext()) { var retryCnt = 0; var maxRetries = 8; var commands = FindCommands(showContext); foreach (var command in commands) { await _mutex.WaitAsync(); try { // read data from the cloud, // based on data from the cloud, write back to the cloud // mark the command as processed in the database await ProcessCommandAsync(showContext, command); } catch (Exception e) { GlobalLogger.Logger.Error(e, $"assinging executing task, Exception in Process Commands pkid = {command.Pkid} "); GlobalLogger.Logger.Error($"Retry count = {retryCnt}"); retryCnt++; await Task.Delay(2000); if (retryCnt == maxRetries) { break; // from for } } finally { _mutex.Release(); } } } } 
added 209 characters in body
Source Link
 private readonly SemaphoreSlim _mutex = new SemaphoreSlim(1); public async Task ProcessPostedCommandsAsync() { using (var showContext = new ShowContext()) { var retryCnt = 0; var maxRetries = 8; var commands = FindCommands(showContext); foreach (var command in commands) { await _mutex.WaitAsync(); try { await // read data from the cloud, // based on data from the cloud, write back to the cloud // mark the command as processed in the database  ProcessCommandAsync(showContext, command); } catch (Exception e) { GlobalLogger.Logger.Error(e, $"assinging executing task, Exception in Process Commands pkid = {command.Pkid} "); GlobalLogger.Logger.Error($"Retry count = {retryCnt}"); retryCnt++; await Task.Delay(2000); if (retryCnt == maxRetries) { break; // from for } } finally { _mutex.Release(); } } } } 
 private readonly SemaphoreSlim _mutex = new SemaphoreSlim(1); public async Task ProcessPostedCommandsAsync() { using (var showContext = new ShowContext()) { var retryCnt = 0; var maxRetries = 8; var commands = FindCommands(showContext); foreach (var command in commands) { await _mutex.WaitAsync(); try { await ProcessCommandAsync(showContext, command); } catch (Exception e) { GlobalLogger.Logger.Error(e, $"assinging executing task, Exception in Process Commands pkid = {command.Pkid} "); GlobalLogger.Logger.Error($"Retry count = {retryCnt}"); retryCnt++; await Task.Delay(2000); if (retryCnt == maxRetries) { break; // from for } } finally { _mutex.Release(); } } } } 
 private readonly SemaphoreSlim _mutex = new SemaphoreSlim(1); public async Task ProcessPostedCommandsAsync() { using (var showContext = new ShowContext()) { var retryCnt = 0; var maxRetries = 8; var commands = FindCommands(showContext); foreach (var command in commands) { await _mutex.WaitAsync(); try {  // read data from the cloud, // based on data from the cloud, write back to the cloud // mark the command as processed in the database  ProcessCommandAsync(showContext, command); } catch (Exception e) { GlobalLogger.Logger.Error(e, $"assinging executing task, Exception in Process Commands pkid = {command.Pkid} "); GlobalLogger.Logger.Error($"Retry count = {retryCnt}"); retryCnt++; await Task.Delay(2000); if (retryCnt == maxRetries) { break; // from for } } finally { _mutex.Release(); } } } } 
added 71 characters in body
Source Link
 private readonly SemaphoreSlim _mutex = new SemaphoreSlim(1); public async Task ProcessPostedCommandsAsync() { using (var showContext = new ShowContext()) { var retryCnt = 0; var maxRetries = 8; var commands = FindCommands(showContext); foreach (var command in commands) { await _mutex.WaitAsync(); try { await ProcessCommandAsync(showContext, command); } catch (Exception e) { GlobalLogger.Logger.Error(e, $"assinging executing task, Exception in Process Commands pkid = {command.Pkid} "); GlobalLogger.Logger.Error($"Retry count = {retryCnt}"); retryCnt++; await Task.Delay(2000); if (retryCnt == maxRetries) { break; // from for } } finally { _mutex.Release(); } } } } 
 public async Task ProcessPostedCommandsAsync() { using (var showContext = new ShowContext()) { var retryCnt = 0; var maxRetries = 8; var commands = FindCommands(showContext); foreach (var command in commands) { await _mutex.WaitAsync(); try { await ProcessCommandAsync(showContext, command); } catch (Exception e) { GlobalLogger.Logger.Error(e, $"assinging executing task, Exception in Process Commands pkid = {command.Pkid} "); GlobalLogger.Logger.Error($"Retry count = {retryCnt}"); retryCnt++; await Task.Delay(2000); if (retryCnt == maxRetries) { break; // from for } } finally { _mutex.Release(); } } } } 
 private readonly SemaphoreSlim _mutex = new SemaphoreSlim(1); public async Task ProcessPostedCommandsAsync() { using (var showContext = new ShowContext()) { var retryCnt = 0; var maxRetries = 8; var commands = FindCommands(showContext); foreach (var command in commands) { await _mutex.WaitAsync(); try { await ProcessCommandAsync(showContext, command); } catch (Exception e) { GlobalLogger.Logger.Error(e, $"assinging executing task, Exception in Process Commands pkid = {command.Pkid} "); GlobalLogger.Logger.Error($"Retry count = {retryCnt}"); retryCnt++; await Task.Delay(2000); if (retryCnt == maxRetries) { break; // from for } } finally { _mutex.Release(); } } } } 
deleted 75 characters in body
Source Link
Loading
deleted 468 characters in body
Source Link
Loading
clarified based on comments
Source Link
Loading
added 1560 characters in body
Source Link
Loading
Source Link
Loading