File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -344,7 +344,7 @@ export class EventRepository {
344
344
} ) ;
345
345
}
346
346
347
- async queryIncompleteEvents ( queryOptions : QueryOptions ) {
347
+ async queryIncompleteEvents ( queryOptions : QueryOptions , allowCompleteDuplicate = false ) {
348
348
// First we will find all the events that match the query options (selecting minimal data).
349
349
const taskEvents = await this . readReplica . taskEvent . findMany ( {
350
350
where : queryOptions ,
@@ -362,6 +362,10 @@ export class EventRepository {
362
362
// If the event is cancelled, it is not incomplete
363
363
if ( event . isCancelled ) return false ;
364
364
365
+ if ( allowCompleteDuplicate ) {
366
+ return true ;
367
+ }
368
+
365
369
// There must not be another complete event with the same spanId
366
370
const hasCompleteDuplicate = taskEvents . some (
367
371
( otherEvent ) =>
Original file line number Diff line number Diff line change @@ -75,9 +75,12 @@ export class CrashTaskRunService extends BaseService {
75
75
} ,
76
76
} ) ;
77
77
78
- const inProgressEvents = await eventRepository . queryIncompleteEvents ( {
79
- runId : taskRun . friendlyId ,
80
- } ) ;
78
+ const inProgressEvents = await eventRepository . queryIncompleteEvents (
79
+ {
80
+ runId : taskRun . friendlyId ,
81
+ } ,
82
+ options ?. overrideCompletion
83
+ ) ;
81
84
82
85
logger . debug ( "Crashing in-progress events" , {
83
86
inProgressEvents : inProgressEvents . map ( ( event ) => event . id ) ,
You can’t perform that action at this time.
0 commit comments