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>
Former-commit-id: 7ab21ae840
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
package auctiora;
|
package auctiora;
|
||||||
|
|
||||||
|
import io.quarkus.runtime.StartupEvent;
|
||||||
import io.quarkus.scheduler.Scheduled;
|
import io.quarkus.scheduler.Scheduled;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
|
import jakarta.enterprise.event.Observes;
|
||||||
import jakarta.inject.Inject;
|
import jakarta.inject.Inject;
|
||||||
import org.eclipse.microprofile.config.inject.ConfigProperty;
|
import org.eclipse.microprofile.config.inject.ConfigProperty;
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
@@ -31,9 +33,26 @@ public class QuarkusWorkflowScheduler {
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ImageProcessingService imageProcessor;
|
ImageProcessingService imageProcessor;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
LotEnrichmentService enrichmentService;
|
||||||
|
|
||||||
@ConfigProperty(name = "auction.database.path")
|
@ConfigProperty(name = "auction.database.path")
|
||||||
String databasePath;
|
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
|
* Workflow 1: Import Scraper Data
|
||||||
|
|||||||
Reference in New Issue
Block a user