[worker] schedule preview cleanup with native cron #162

Merged
eleith merged 1 commits from feat/native-preview-maintenance into main 2026-10-27 17:37:49 +00:00

Summary

Follows #161.

  • Replace startup cleanup and the 24-hour process timer with OpenWorkflow's persisted daily schedule.
  • Queue at 01:48 UTC, save a fresh 0–24 minute random delay per run, and wait through native durable sleep. Cleanup normally runs near 02:00 UTC ±12 minutes without holding the worker slot.
  • Find known finished jobs from existing preview directories and app progress/log rows. Keep active, recent and unknown jobs untouched.
  • Checkpoint deletion targets, remove files first, then transactionally remove their app rows. Failures propagate and retries reuse the saved targets. Engine history remains intact.
  • Delete the unused duplicate purge step/test and add a short operations note.

Verification

  • Independent code/readability reviews and source-verified closures: clear.
  • All 23 checks passed; 2,423 tests passed.
  • Jobs/config/helpers/theme coverage: 100%; worker line coverage 98.57% (previously 98.34%).
  • Svelte: zero errors, the same 27 existing warnings in seven untouched files.
  • Native SDK tests cover schedule persistence, pause across restart, coalesced downtime catch-up, no boot run, durable jitter/reopen, released worker capacity, cleanup eligibility, file/app deletion failures and history preservation.
  • Existing HTTP/SSR integration passes. Config/schema/dependencies, archives, catalogs, OG compiler and protected samples are unchanged.

Boundaries

Queue backlog or downtime can delay execution beyond the normal jitter window. Unknown directories whose SDK history is missing are preserved; this is not historical orphan repair. There is no private SDK SQL, engine-history deletion, custom scheduler, new service or user configuration API.

Production Docker/browser/Nginx/performance testing remains owner-owned and was not run. Dev images need the OpenWorkflow 0.11.0 dependencies from #161; source mounts alone do not update installed packages.

## Summary Follows #161. - Replace startup cleanup and the 24-hour process timer with OpenWorkflow's persisted daily schedule. - Queue at **01:48 UTC**, save a fresh **0–24 minute** random delay per run, and wait through native durable sleep. Cleanup normally runs near **02:00 UTC ±12 minutes** without holding the worker slot. - Find known finished jobs from existing preview directories and app progress/log rows. Keep active, recent and unknown jobs untouched. - Checkpoint deletion targets, remove files first, then transactionally remove their app rows. Failures propagate and retries reuse the saved targets. **Engine history remains intact.** - Delete the unused duplicate purge step/test and add a short operations note. ## Verification - Independent code/readability reviews and source-verified closures: clear. - All **23 checks** passed; **2,423 tests** passed. - Jobs/config/helpers/theme coverage: 100%; worker line coverage **98.57%** (previously 98.34%). - Svelte: zero errors, the same 27 existing warnings in seven untouched files. - Native SDK tests cover schedule persistence, pause across restart, coalesced downtime catch-up, no boot run, durable jitter/reopen, released worker capacity, cleanup eligibility, file/app deletion failures and history preservation. - Existing HTTP/SSR integration passes. Config/schema/dependencies, archives, catalogs, OG compiler and protected samples are unchanged. ## Boundaries Queue backlog or downtime can delay execution beyond the normal jitter window. Unknown directories whose SDK history is missing are preserved; this is not historical orphan repair. There is no private SDK SQL, engine-history deletion, custom scheduler, new service or user configuration API. Production Docker/browser/Nginx/performance testing remains owner-owned and was not run. Dev images need the OpenWorkflow 0.11.0 dependencies from #161; source mounts alone do not update installed packages.
eleith-gitea-agent Bot added 1 commit 2026-10-27 17:34:13 +00:00
[worker] schedule preview cleanup with native cron
ci/woodpecker/pr/web-jobs Pipeline was successful
ci/woodpecker/pr/web-worker Pipeline was successful
ci/woodpecker/pr/web Pipeline was successful
ci/woodpecker/push/web-jobs Pipeline was successful
ci/woodpecker/push/web-worker Pipeline was successful
ci/woodpecker/push/web Pipeline was successful
5526f96833
eleith merged commit 5526f96833 into main 2026-10-27 17:37:49 +00:00
eleith deleted branch feat/native-preview-maintenance 2026-10-27 17:37:49 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: eleith/luzzle#162