feat(jobs): add durable due-time job runner with leases

This commit is contained in:
shira committed 2026-10-06 14:29:23 +03:00
1 parent 7e80c8ad2a
commit 008254e44a
39 files changed
+4909 -43

No files matched your search

@@ -138,6 +138,24 @@ type PolicyVersion struct {
CreatedAt pgtype.Timestamptz
}
type ScheduledJob struct {
ID int64
Kind string
DedupKey string
Payload []byte
DueAt pgtype.Timestamptz
AvailableAt pgtype.Timestamptz
Status string
Attempts int32
MaxAttempts pgtype.Int4
LeaseOwner pgtype.UUID
LeaseExpiresAt pgtype.Timestamptz
StartedAt pgtype.Timestamptz
LastErrorClass pgtype.Text
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
}
type Session struct {
ID pgtype.UUID
UserID pgtype.UUID