mirror of
https://github.com/Monkopedia/rouse-context.git
synced 2026-12-03 03:44:54 +00:00
Before this change, `RouseApplication.onCreate` only scheduled the 24h periodic `CertRenewalWorker`. A user who opens the app with an already- expired cert would sit stuck for up to 24h before the first periodic tick. The tunnel's mTLS handshake fails on an expired cert, so there was no in-band recovery path. Add `CertRenewalScheduler.enqueueImmediateIfExpiring` which reads the stored cert's expiry, compares it to a configurable threshold (default: the worker's own 21-day renewal window), and enqueues a one-time `CertRenewalWorker` under a dedicated unique-work slot (`cert_renewal_immediate`) when the cert is near-or-past expiry. `ExistingWorkPolicy.KEEP` avoids resetting run attempts on repeated app restarts. Wire this into `RouseApplication.onCreate` after the existing `enqueuePeriodic` call. The new unique-work slot is distinct from the periodic slot so the 24h schedule is preserved as the long-running safety net. Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| build.gradle.kts | ||