File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 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({
483483 COMMON_WORKER_REDIS_CLUSTER_MODE_ENABLED : z . string ( ) . default ( "0" ) ,
484484
485485 TASK_EVENT_PARTITIONING_ENABLED : z . string ( ) . default ( "0" ) ,
486+ TASK_EVENT_PARTITIONED_WINDOW_IN_SECONDS : z . coerce . number ( ) . int ( ) . default ( 60 ) , // 1 minute
486487} ) ;
487488
488489export type Environment = z . infer < typeof EnvironmentSchema > ;
Original file line number Diff line number Diff line change @@ -81,7 +81,9 @@ export class TaskEventStore {
8181
8282 if ( table === "taskEventPartitioned" && startCreatedAt ) {
8383 // 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 ( ) ;
8587
8688 finalWhere = {
8789 AND : [
@@ -140,7 +142,7 @@ export class TaskEventStore {
140142 "traceId" = ${ traceId }
141143 AND "createdAt" >= ${ startCreatedAt . toISOString ( ) } ::timestamp
142144 AND "createdAt" < ${ ( endCreatedAt
143- ? new Date ( endCreatedAt . getTime ( ) + 60_000 )
145+ ? new Date ( endCreatedAt . getTime ( ) + env . TASK_EVENT_PARTITIONED_WINDOW_IN_SECONDS * 1000 )
144146 : new Date ( )
145147 ) . toISOString ( ) } ::timestamp
146148 ORDER BY "startTime" ASC
You can’t perform that action at this time.
0 commit comments