carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1package hostops
2
3import "context"
4
5const RegistrationWakeRetryReset = "reset-wake-retry"
6
7func (h *StartHandle) FinishWakeRetryReset(ctx context.Context) error {
8 _, err := h.w.retryAdmission(ctx, h.account, h.app, h.appID, AdmissionObserved{}, func(a *AppAdmission) error {
9 r, ok := a.Registrations[h.id]
10 if !ok {
11 return nil
12 }
13 if r.Kind != RegistrationWakeRetryReset || r.Owner != h.owner || r.AppID != h.appID || r.Epoch != h.epoch || a.Epoch != h.epoch || !effectsSettled(a, h.id) {
14 return ErrPending
15 }
16 r.Expires = h.w.now().UTC().Add(-RegistrationSkew)
17 a.Registrations[h.id] = r
18 return nil
19 })
20 return err
21}
22