@@ -86,10 +86,10 @@ public HangfireWorkflowExecutor(IWorkflowAccessor workflowAccessor, IHangfireAct
8686 public async ValueTask < object > ExecuteAsync ( IRunContext run , IWorkflow workflow , IAction action , PerformContext context )
8787 {
8888 try
89- {
89+ {
9090 runContextAccessor . RunContext = run ;
9191 arrayContext . JobId = context . BackgroundJob . Id ;
92-
92+ var queue = context . BackgroundJob . Job . Queue ?? "default" ;
9393
9494 var result = await actionExecutor . ExecuteAsync ( run , workflow , action ) ;
9595
@@ -109,12 +109,12 @@ public async ValueTask<object> ExecuteAsync(IRunContext run, IWorkflow workflow,
109109 if ( result . DelayNextAction . HasValue )
110110 {
111111
112- var workflowRunId = backgroundJobClient . Schedule < IHangfireActionExecutor > (
112+ var workflowRunId = backgroundJobClient . Schedule < IHangfireActionExecutor > ( queue ,
113113 ( executor ) => executor . ExecuteAsync ( run , workflow , next , null ) , result . DelayNextAction . Value ) ;
114114 }
115115 else
116116 {
117- var workflowRunId = backgroundJobClient . Enqueue < IHangfireActionExecutor > (
117+ var workflowRunId = backgroundJobClient . Enqueue < IHangfireActionExecutor > ( queue ,
118118 ( executor ) => executor . ExecuteAsync ( run , workflow , next , null ) ) ;
119119 }
120120
@@ -133,14 +133,14 @@ public async ValueTask<object> ExecuteAsync(IRunContext run, IWorkflow workflow,
133133 if ( result . DelayNextAction != null )
134134 {
135135
136- var workflowRunId = backgroundJobClient . Schedule < IHangfireActionExecutor > (
136+ var workflowRunId = backgroundJobClient . Schedule < IHangfireActionExecutor > ( queue ,
137137 ( executor ) => executor . ExecuteAsync ( run , workflow , scopeAction , null ) , result . DelayNextAction . Value ) ;
138138 }
139139 else
140140 {
141141
142142
143- var workflowRunId = backgroundJobClient . Enqueue < IHangfireActionExecutor > (
143+ var workflowRunId = backgroundJobClient . Enqueue < IHangfireActionExecutor > ( queue ,
144144 ( executor ) => executor . ExecuteAsync ( run , workflow , scopeAction , null ) ) ;
145145 }
146146 //await outputRepository.EndScope(run, workflow, action);
@@ -177,8 +177,8 @@ public async ValueTask<object> TriggerAsync(ITriggerContext triggerContext)
177177 /// <param name="triggerContext"></param>
178178 /// <returns></returns>
179179 public async ValueTask < object > TriggerAsync ( ITriggerContext triggerContext , PerformContext context = null )
180- {
181-
180+ {
181+ var queue = context . BackgroundJob . Job . Queue ?? "default" ;
182182 triggerContext . RunId = triggerContext . RunId == Guid . Empty ? Guid . NewGuid ( ) : triggerContext . RunId ;
183183 triggerContext . JobId = context ? . BackgroundJob . Id ;
184184
@@ -187,7 +187,7 @@ public async ValueTask<object> TriggerAsync(ITriggerContext triggerContext, Perf
187187
188188 if ( action != null )
189189 {
190- var a = backgroundJobClient . Enqueue < IHangfireActionExecutor > (
190+ var a = backgroundJobClient . Enqueue < IHangfireActionExecutor > ( queue ,
191191 ( executor ) => executor . ExecuteAsync ( triggerContext , triggerContext . Workflow , action , null ) ) ;
192192 }
193193 return action ;
0 commit comments