@@ -35,10 +35,10 @@ protected override async Task ProcessItem(string itemId, CancellationToken cance
3535 Logger . LogInformation ( "Workflow locked {0}" , itemId ) ;
3636 return ;
3737 }
38-
38+
3939 WorkflowInstance workflow = null ;
4040 WorkflowExecutorResult result = null ;
41-
41+
4242 try
4343 {
4444 cancellationToken . ThrowIfCancellationRequested ( ) ;
@@ -77,9 +77,9 @@ protected override async Task ProcessItem(string itemId, CancellationToken cance
7777 }
7878 }
7979 }
80-
80+
8181 }
82-
82+
8383 private async Task SubscribeEvent ( EventSubscription subscription , IPersistenceProvider persistenceStore , CancellationToken cancellationToken )
8484 {
8585 //TODO: move to own class
@@ -100,8 +100,8 @@ private async Task SubscribeEvent(EventSubscription subscription, IPersistencePr
100100 int attempt = 0 ;
101101 while ( ! acquiredLock && attempt < 10 )
102102 {
103- acquiredLock = await _lockProvider . AcquireLock ( eventKey , cancellationToken ) ;
104103 await Task . Delay ( Options . IdleTime , cancellationToken ) ;
104+ acquiredLock = await _lockProvider . AcquireLock ( eventKey , cancellationToken ) ;
105105
106106 attempt ++ ;
107107 }
@@ -112,9 +112,9 @@ private async Task SubscribeEvent(EventSubscription subscription, IPersistencePr
112112 }
113113 else
114114 {
115+ _greylist . Remove ( eventKey ) ;
115116 await persistenceStore . MarkEventUnprocessed ( evt , cancellationToken ) ;
116117 await QueueProvider . QueueWork ( evt , QueueType . Event ) ;
117- _greylist . Remove ( eventKey ) ;
118118 }
119119 }
120120 finally
0 commit comments