@@ -55,7 +55,7 @@ protected override async Task ProcessItem(string itemId, CancellationToken cance
55
55
finally
56
56
{
57
57
WorkflowActivity . Enrich ( result ) ;
58
- await _persistenceStore . PersistWorkflow ( workflow , cancellationToken ) ;
58
+ await _persistenceStore . PersistWorkflow ( workflow , result . Subscriptions , cancellationToken ) ;
59
59
await QueueProvider . QueueWork ( itemId , QueueType . Index ) ;
60
60
_greylist . Remove ( $ "wf:{ itemId } ") ;
61
61
}
@@ -68,7 +68,7 @@ protected override async Task ProcessItem(string itemId, CancellationToken cance
68
68
{
69
69
foreach ( var sub in result . Subscriptions )
70
70
{
71
- await SubscribeEvent ( sub , _persistenceStore , cancellationToken ) ;
71
+ await TryProcessSubscription ( sub , _persistenceStore , cancellationToken ) ;
72
72
}
73
73
74
74
await _persistenceStore . PersistErrors ( result . Errors , cancellationToken ) ;
@@ -98,12 +98,8 @@ await _persistenceStore.ScheduleCommand(new ScheduledCommand()
98
98
99
99
}
100
100
101
- private async Task SubscribeEvent ( EventSubscription subscription , IPersistenceProvider persistenceStore , CancellationToken cancellationToken )
101
+ private async Task TryProcessSubscription ( EventSubscription subscription , IPersistenceProvider persistenceStore , CancellationToken cancellationToken )
102
102
{
103
- //TODO: move to own class
104
- Logger . LogDebug ( "Subscribing to event {EventName} {EventKey} for workflow {WorkflowId} step {StepId}" , subscription . EventName , subscription . EventKey , subscription . WorkflowId , subscription . StepId ) ;
105
-
106
- await persistenceStore . CreateEventSubscription ( subscription , cancellationToken ) ;
107
103
if ( subscription . EventName != Event . EventTypeActivity )
108
104
{
109
105
var events = await persistenceStore . GetEvents ( subscription . EventName , subscription . EventKey , subscription . SubscribeAsOf , cancellationToken ) ;
0 commit comments