feat: daily scenario generation scheduling at midnight KST#41
Merged
dev-yunseong merged 3 commits intomainfrom Mar 17, 2026
Merged
feat: daily scenario generation scheduling at midnight KST#41dev-yunseong merged 3 commits intomainfrom
dev-yunseong merged 3 commits intomainfrom
Conversation
Co-authored-by: dev-yunseong <88422717+dev-yunseong@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add scheduling for scenario creation at midnight
feat: daily scenario generation scheduling at midnight KST
Mar 17, 2026
Collaborator
|
@copilot |
Collaborator
|
@copilot 내일 날짜로 이미 시나리오가 있으면 생성을 스킵하는 기능도 만들어줘 |
…startup Co-authored-by: dev-yunseong <88422717+dev-yunseong@users.noreply.github.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements automated daily scenario generation triggered at 00:00 KST: requests AI server generation, polls for completion, generates images, and assigns the result as the next day's scenario — with up to 5 retries on any failure.
Key changes
@EnableSchedulingadded toMainServerApplicationScenarioDailyScheduler(new component):0 0 0 * * *Asia/Seoul via@Scheduled; launches work in a non-blockingCoroutineScope(Dispatchers.IO + SupervisorJob())@EventListener(ApplicationReadyEvent::class)ScenarioRepository.findByDatecheck) — prevents duplicate generation on midnight cron or server restartnow + 1 day) captured once before the retry loop — consistent across all attempts regardless of execution durationAiClient.getScenarioCreateTask(key)every 30 s; hard cap of 240 polls (2 h) prevents unbounded executionCOMPLETED: runsImageGenerationService.generateImagesForScenario→AdminService.updateScenarioDate(tomorrow)FAILED, poll timeout, or any exception: returnsfalse→ outer loop retries up to 5 timesScenarioDailySchedulerTest— 8 unit tests usingrunTest(virtual time; no real 30 s waits) covering: skip when tomorrow's scenario exists, happy path, retry-then-succeed, max retries exhausted,startGenerationthrows, nullscenarioId, poll timeout, and poll exception recoveryOriginal prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.