Files
hatchet/pkg/scheduling/timeout.go
Gabe Ruttner 4ea4712d4d refactor: performance and throughput (#756)
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>
2024-08-12 14:38:47 +00:00

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
}