@@ -172,7 +172,7 @@ func (pge *PgEngine) ExecuteSQLTask(ctx context.Context, tx pgx.Tx, task *ChainT
172172 }
173173 }
174174
175- pge .SetCurrentTaskContext (ctx , execTx , task .TaskID )
175+ pge .SetCurrentTaskContext (ctx , executor , task .TaskID )
176176 out , err = pge .ExecuteSQLCommand (ctx , executor , task .Script , paramValues )
177177
178178 if err != nil && task .IgnoreError && ! task .Autonomous {
@@ -282,10 +282,10 @@ func (pge *PgEngine) ResetRole(ctx context.Context, tx pgx.Tx) {
282282}
283283
284284// SetCurrentTaskContext - set the working transaction "pg_timetable.current_task_id" run-time parameter
285- func (pge * PgEngine ) SetCurrentTaskContext (ctx context.Context , tx pgx. Tx , taskID int ) {
285+ func (pge * PgEngine ) SetCurrentTaskContext (ctx context.Context , executor executor , taskID int ) {
286286 l := log .GetLogger (ctx )
287287 l .Debug ("Setting current task context to " , taskID )
288- _ , err := tx .Exec (ctx , "SELECT set_config('pg_timetable.current_task_id', $1, true)" , strconv .Itoa (taskID ))
288+ _ , err := executor .Exec (ctx , "SELECT set_config('pg_timetable.current_task_id', $1, true)" , strconv .Itoa (taskID ))
289289 if err != nil {
290290 l .WithError (err ).Error ("Failed to set current task context" , err )
291291 }
0 commit comments