feat(mail): send service identity mail through a leased worker

This commit is contained in:
shira committed 2026-10-06 21:08:11 +03:00
1 parent 204c6bae62
commit d21fd49a42
58 files changed
+7577 -164

No files matched your search

@@ -40,8 +40,8 @@ var (
// is used up: the delivery waits for the reset in waiting_quota, and an
// operator may decide otherwise.
//
// The sending worker (TASK-016) uses it in two transactions around one
// transport call:
// The sending worker (ServiceMailSender, TASK-016) uses it in two
// transactions around one transport call:
//
// 1. PrepareSend in the transaction that claims a due delivery. It either
// returns a permit, or parks the delivery in waiting_quota until the
@@ -82,6 +82,9 @@ type QuotaPermit struct {
reused bool
}
// IdempotencyWindow returns the window the gate was built with.
func (gate *QuotaGate) IdempotencyWindow() time.Duration { return gate.idempotencyWindow }
func (permit QuotaPermit) IsZero() bool { return permit.reservation.ID == uuid.Nil }
// Reused reports a permit that continues the open reservation of an earlier