Add startup enrichment trigger for lot intelligence data

- Added StartupEvent observer to QuarkusWorkflowScheduler
- Triggers enrichment of lots closing within 24 hours on startup
- Ensures bid intelligence data is populated immediately after deployment
- Fixes issue where server showed 0 lots with bids

This ensures the GraphQL enrichment service runs at startup to populate
bid_count, starting_bid, followers_count and other intelligence fields.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Tour
2025-12-07 14:43:10 +01:00
parent 12c3a732e4
commit 7ab21ae840

View File

@@ -1,7 +1,9 @@
package auctiora;
import io.quarkus.runtime.StartupEvent;
import io.quarkus.scheduler.Scheduled;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.event.Observes;
import jakarta.inject.Inject;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.jboss.logging.Logger;
@@ -31,9 +33,26 @@ public class QuarkusWorkflowScheduler {
@Inject
ImageProcessingService imageProcessor;
@Inject
LotEnrichmentService enrichmentService;
@ConfigProperty(name = "auction.database.path")
String databasePath;
/**
* Triggered on application startup to enrich existing lots with bid intelligence
*/
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());
}
}
/**
* Workflow 1: Import Scraper Data