File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Hangfire.Redis.StackExchange Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 11using System ;
22using System . Collections . Generic ;
3+ using System . Diagnostics ;
34using System . Linq ;
45using System . Threading ;
56using System . Threading . Tasks ;
@@ -54,7 +55,7 @@ void IServerComponent.Execute(CancellationToken cancellationToken)
5455 var count = redis . ListLength ( redisKey ) ;
5556 if ( count == 0 ) continue ;
5657
57- Logger . InfoFormat ( "Removing expired records from the '{0}' list..." , key ) ;
58+ Logger . DebugFormat ( "Removing expired records from the '{0}' list..." , key ) ;
5859
5960 const int batchSize = 100 ;
6061 var keysToRemove = new List < string > ( ) ;
@@ -82,7 +83,7 @@ void IServerComponent.Execute(CancellationToken cancellationToken)
8283
8384 if ( keysToRemove . Count == 0 ) continue ;
8485
85- Logger . InfoFormat ( "Removing {0 } expired jobs from '{1 }' list..." , keysToRemove . Count , key ) ;
86+ Logger . Info ( $ "Removing { keysToRemove . Count } expired jobs from '{ key } ' list...") ;
8687
8788 using ( var transaction = connection . CreateWriteTransaction ( ) )
8889 {
@@ -96,7 +97,13 @@ void IServerComponent.Execute(CancellationToken cancellationToken)
9697 }
9798 }
9899
100+ var watch = Stopwatch . StartNew ( ) ;
99101 cancellationToken . WaitHandle . WaitOne ( _checkInterval ) ;
102+ watch . Stop ( ) ;
103+ if ( watch . Elapsed < _checkInterval )
104+ {
105+ Logger . Warn ( $ "Waited for '{ watch . Elapsed } ' which was less than the check interval of '{ _checkInterval } '") ;
106+ }
100107 }
101108 }
102109}
You can’t perform that action at this time.
0 commit comments