Download this file
| 1 | package hostops |
| 2 | |
| 3 | import "context" |
| 4 | |
| 5 | const RegistrationWakeRetryReset = "reset-wake-retry" |
| 6 | |
| 7 | func (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 | |