Enrich ALL lots on startup in background thread

Former-commit-id: afd7b311a9
This commit is contained in:
Tour
2025-12-07 14:48:36 +01:00
parent f6f37ff9d1
commit 22c1e99c4a

View File

@@ -45,13 +45,17 @@ public class QuarkusWorkflowScheduler {
*/ */
void onStart(@Observes StartupEvent ev) { void onStart(@Observes StartupEvent ev) {
LOG.info("🚀 Application started - triggering initial lot enrichment..."); LOG.info("🚀 Application started - triggering initial lot enrichment...");
// Run enrichment in background thread to not block startup
new Thread(() -> {
try { try {
// Enrich lots closing within 24 hours as high priority on startup Thread.sleep(5000); // Wait 5 seconds for application to fully start
int enriched = enrichmentService.enrichClosingSoonLots(24); LOG.info("Starting full lot enrichment in background...");
int enriched = enrichmentService.enrichAllActiveLots();
LOG.infof("✓ Startup enrichment complete: %d lots enriched", enriched); LOG.infof("✓ Startup enrichment complete: %d lots enriched", enriched);
} catch (Exception e) { } catch (Exception e) {
LOG.errorf(e, "❌ Startup enrichment failed: %s", e.getMessage()); LOG.errorf(e, "❌ Startup enrichment failed: %s", e.getMessage());
} }
}).start();
} }
/** /**