From 22c1e99c4a7413feafda9f955a3bcaa7591c0969 Mon Sep 17 00:00:00 2001 From: Tour Date: Sun, 7 Dec 2025 14:48:36 +0100 Subject: [PATCH] Enrich ALL lots on startup in background thread Former-commit-id: afd7b311a9c9b8fe565c6d10e5a627ba1c16cddf --- .../auctiora/QuarkusWorkflowScheduler.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/main/java/auctiora/QuarkusWorkflowScheduler.java b/src/main/java/auctiora/QuarkusWorkflowScheduler.java index fc8f425..976e7dd 100644 --- a/src/main/java/auctiora/QuarkusWorkflowScheduler.java +++ b/src/main/java/auctiora/QuarkusWorkflowScheduler.java @@ -45,13 +45,17 @@ public class QuarkusWorkflowScheduler { */ void onStart(@Observes StartupEvent ev) { LOG.info("🚀 Application started - triggering initial lot enrichment..."); - try { - // Enrich lots closing within 24 hours as high priority on startup - int enriched = enrichmentService.enrichClosingSoonLots(24); - LOG.infof("✓ Startup enrichment complete: %d lots enriched", enriched); - } catch (Exception e) { - LOG.errorf(e, "❌ Startup enrichment failed: %s", e.getMessage()); - } + // Run enrichment in background thread to not block startup + new Thread(() -> { + try { + Thread.sleep(5000); // Wait 5 seconds for application to fully start + LOG.info("Starting full lot enrichment in background..."); + 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(); } /**