File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -483,6 +483,7 @@ const EnvironmentSchema = z.object({
483
483
COMMON_WORKER_REDIS_CLUSTER_MODE_ENABLED : z . string ( ) . default ( "0" ) ,
484
484
485
485
TASK_EVENT_PARTITIONING_ENABLED : z . string ( ) . default ( "0" ) ,
486
+ TASK_EVENT_PARTITIONED_WINDOW_IN_SECONDS : z . coerce . number ( ) . int ( ) . default ( 60 ) , // 1 minute
486
487
} ) ;
487
488
488
489
export type Environment = z . infer < typeof EnvironmentSchema > ;
Original file line number Diff line number Diff line change @@ -81,7 +81,9 @@ export class TaskEventStore {
81
81
82
82
if ( table === "taskEventPartitioned" && startCreatedAt ) {
83
83
// Add 1 minute to endCreatedAt to make sure we include all events in the range.
84
- const end = endCreatedAt ? new Date ( endCreatedAt . getTime ( ) + 60_000 ) : new Date ( ) ;
84
+ const end = endCreatedAt
85
+ ? new Date ( endCreatedAt . getTime ( ) + env . TASK_EVENT_PARTITIONED_WINDOW_IN_SECONDS * 1000 )
86
+ : new Date ( ) ;
85
87
86
88
finalWhere = {
87
89
AND : [
@@ -140,7 +142,7 @@ export class TaskEventStore {
140
142
"traceId" = ${ traceId }
141
143
AND "createdAt" >= ${ startCreatedAt . toISOString ( ) } ::timestamp
142
144
AND "createdAt" < ${ ( endCreatedAt
143
- ? new Date ( endCreatedAt . getTime ( ) + 60_000 )
145
+ ? new Date ( endCreatedAt . getTime ( ) + env . TASK_EVENT_PARTITIONED_WINDOW_IN_SECONDS * 1000 )
144
146
: new Date ( )
145
147
) . toISOString ( ) } ::timestamp
146
148
ORDER BY "startTime" ASC
You can’t perform that action at this time.
0 commit comments