Skip to content

Use @Context for RetentionWorker eager initialization#1069

Merged
aaylward merged 1 commit intomainfrom
retention_again
Feb 26, 2026
Merged

Use @Context for RetentionWorker eager initialization#1069
aaylward merged 1 commit intomainfrom
retention_again

Conversation

@aaylward
Copy link
Copy Markdown
Collaborator

Summary

  • @Singleton is lazy in Micronaut — RetentionWorker was never instantiated because nothing injects it
  • Switch to @Context to force eager creation at startup so the @Scheduled method registers with the scheduler

Test plan

  • All 25 one_d4 tests pass
  • Deploy and verify "Running game retention policy (7 days)" appears in logs ~1 minute after startup

@singleton is lazy in Micronaut — the bean was never created because
nothing injects it. @context forces eager initialization at startup so
the @scheduled method is registered with the scheduler.
@aaylward aaylward enabled auto-merge (squash) February 26, 2026 00:31
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
1d4-web 3940b85 Commit Preview URL

Branch Preview URL
Feb 26 2026, 12:31 AM

@aaylward aaylward merged commit 782ecfb into main Feb 26, 2026
12 checks passed
@aaylward aaylward deleted the retention_again branch February 26, 2026 00:36
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.

1 participant