Skip to content

Commit

Permalink
Fix queued at timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
jessarcher committed Nov 3, 2023
1 parent 352bdf2 commit 8330c02
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Queries/Queues.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ public function __invoke(Interval $interval): Collection
->selectRaw('NULL AS `processed_at`')
->selectRaw('NULL AS `failed_at`')
// Divide the data into buckets.
->selectRaw('FLOOR(UNIX_TIMESTAMP(CONVERT_TZ(`date`, ?, @@session.time_zone)) / ?) AS `bucket`', [$now->format('P'), $secondsPerPeriod])
->where('date', '>=', $now->ceilSeconds($interval->totalSeconds / $maxDataPoints)->subSeconds((int) $interval->totalSeconds))
->whereNotNull('date')
->selectRaw('FLOOR(UNIX_TIMESTAMP(CONVERT_TZ(`queued_at`, ?, @@session.time_zone)) / ?) AS `bucket`', [$now->format('P'), $secondsPerPeriod])
->where('queued_at', '>=', $now->ceilSeconds($interval->totalSeconds / $maxDataPoints)->subSeconds((int) $interval->totalSeconds))
->whereNotNull('queued_at')
// Processing
->union(fn (Builder $query) => $query
->from('pulse_jobs')
Expand Down

0 comments on commit 8330c02

Please sign in to comment.