Enrich ALL lots on startup in background thread
This commit is contained in:
@@ -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...");
|
||||||
try {
|
// Run enrichment in background thread to not block startup
|
||||||
// Enrich lots closing within 24 hours as high priority on startup
|
new Thread(() -> {
|
||||||
int enriched = enrichmentService.enrichClosingSoonLots(24);
|
try {
|
||||||
LOG.infof("✓ Startup enrichment complete: %d lots enriched", enriched);
|
Thread.sleep(5000); // Wait 5 seconds for application to fully start
|
||||||
} catch (Exception e) {
|
LOG.info("Starting full lot enrichment in background...");
|
||||||
LOG.errorf(e, "❌ Startup enrichment failed: %s", e.getMessage());
|
int enriched = enrichmentService.enrichAllActiveLots();
|
||||||
}
|
LOG.infof("✓ Startup enrichment complete: %d lots enriched", enriched);
|
||||||
|
} catch (Exception e) {
|
||||||
|
LOG.errorf(e, "❌ Startup enrichment failed: %s", e.getMessage());
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user