Skip to content

fix(cms): handle missing collections dir in cron saveVersions#1025

Merged
stevenle merged 1 commit intomainfrom
fix/cron-missing-collections-dir
Apr 4, 2026
Merged

fix(cms): handle missing collections dir in cron saveVersions#1025
stevenle merged 1 commit intomainfrom
fix/cron-missing-collections-dir

Conversation

@jeremydw
Copy link
Copy Markdown
Member

@jeremydw jeremydw commented Apr 4, 2026

The saveVersions cron job calls listCollections() which globs for *.schema.ts files in the collections/ directory. If the directory doesn't exist (e.g. when not included in the GAE deploy bundle), tiny-glob throws an ENOENT error, causing the entire cron to fail with a 500 every invocation.

This returns an empty array instead when the collections/ directory is missing, which is the correct behavior — if there are no collections, there are no versions to save.

The saveVersions cron job calls listCollections() which globs for
*.schema.ts files in the collections/ directory. If the directory
doesn't exist (e.g. when not included in the GAE deploy bundle),
tiny-glob throws an ENOENT error, causing the entire cron to fail
with a 500 every minute.

Return an empty array instead when the collections directory is
missing.
@jeremydw jeremydw force-pushed the fix/cron-missing-collections-dir branch from a352b92 to ce4002c Compare April 4, 2026 00:47
@jeremydw jeremydw requested a review from stevenle April 4, 2026 00:53
@stevenle stevenle merged commit 4fdbb68 into main Apr 4, 2026
1 check passed
@stevenle stevenle deleted the fix/cron-missing-collections-dir branch April 4, 2026 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants