Skip to content

Commit

Permalink
Don't compute format every time given the interval is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmarbach committed Oct 16, 2019
1 parent 06dd620 commit 51d708e
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public DelayedMessageHandler(DelayedMessageTable table, SqlConnectionFactory con
this.connectionFactory = connectionFactory;
this.interval = interval;
this.batchSize = batchSize;
message = $"Scheduling next attempt to move matured delayed messages to input queue in {interval}";
}

public void Start()
Expand Down Expand Up @@ -64,16 +65,14 @@ async Task MoveMaturedDelayedMessages()
}
finally
{
if (!cancellationToken.IsCancellationRequested && Logger.IsDebugEnabled)
{
Logger.DebugFormat("Scheduling next attempt to move matured delayed messages to input queue in {0}", interval);
}
Logger.DebugFormat(message);
await Task.Delay(interval, cancellationToken).IgnoreCancellation()
.ConfigureAwait(false);
}
}
}

string message;
DelayedMessageTable table;
SqlConnectionFactory connectionFactory;
TimeSpan interval;
Expand Down

0 comments on commit 51d708e

Please sign in to comment.