@@ -35,10 +35,10 @@ protected override async Task ProcessItem(string itemId, CancellationToken cance
35
35
Logger . LogInformation ( "Workflow locked {0}" , itemId ) ;
36
36
return ;
37
37
}
38
-
38
+
39
39
WorkflowInstance workflow = null ;
40
40
WorkflowExecutorResult result = null ;
41
-
41
+
42
42
try
43
43
{
44
44
cancellationToken . ThrowIfCancellationRequested ( ) ;
@@ -77,9 +77,9 @@ protected override async Task ProcessItem(string itemId, CancellationToken cance
77
77
}
78
78
}
79
79
}
80
-
80
+
81
81
}
82
-
82
+
83
83
private async Task SubscribeEvent ( EventSubscription subscription , IPersistenceProvider persistenceStore , CancellationToken cancellationToken )
84
84
{
85
85
//TODO: move to own class
@@ -100,8 +100,8 @@ private async Task SubscribeEvent(EventSubscription subscription, IPersistencePr
100
100
int attempt = 0 ;
101
101
while ( ! acquiredLock && attempt < 10 )
102
102
{
103
- acquiredLock = await _lockProvider . AcquireLock ( eventKey , cancellationToken ) ;
104
103
await Task . Delay ( Options . IdleTime , cancellationToken ) ;
104
+ acquiredLock = await _lockProvider . AcquireLock ( eventKey , cancellationToken ) ;
105
105
106
106
attempt ++ ;
107
107
}
@@ -112,9 +112,9 @@ private async Task SubscribeEvent(EventSubscription subscription, IPersistencePr
112
112
}
113
113
else
114
114
{
115
+ _greylist . Remove ( eventKey ) ;
115
116
await persistenceStore . MarkEventUnprocessed ( evt , cancellationToken ) ;
116
117
await QueueProvider . QueueWork ( evt , QueueType . Event ) ;
117
- _greylist . Remove ( eventKey ) ;
118
118
}
119
119
}
120
120
finally
0 commit comments