mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2025-12-30 13:19:44 -06:00
Refactors the queueing logic to be fairly balanced between actions, with each action backed as a separate FIFO queue. Also adds support for priority queueing and custom queues, though those aren't exposed on the API layer yet. Improves throughput to be > 5000 tasks/second on a single queue. --------- Co-authored-by: Alexander Belanger <alexander@hatchet.run>
15 lines
442 B
Go
15 lines
442 B
Go
package scheduling
|
|
|
|
import "time"
|
|
|
|
func IsTimedout(qi *QueueItemWithOrder) bool {
|
|
// if the current time is after the scheduleTimeoutAt, then mark this as timed out
|
|
now := time.Now().UTC().UTC()
|
|
scheduleTimeoutAt := qi.ScheduleTimeoutAt.Time
|
|
|
|
// timed out if the scheduleTimeoutAt is set and the current time is after the scheduleTimeoutAt
|
|
isTimedOut := !scheduleTimeoutAt.IsZero() && scheduleTimeoutAt.Before(now)
|
|
|
|
return isTimedOut
|
|
}
|