mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-01 17:17:24 -04:00
feat: add duplicate detection to job creation
- Skip already-completed model-day pairs in create_job() - Return warnings for skipped simulations - Raise error if all simulations are already completed - Update create_job() return type from str to Dict[str, Any] - Update all callers to handle new dict return type - Add comprehensive test coverage for duplicate detection - Log warnings when simulations are skipped
This commit is contained in:
@@ -280,12 +280,18 @@ def create_app(
|
||||
|
||||
# Create job immediately with all requested dates
|
||||
# Worker will handle data download and filtering
|
||||
job_id = job_manager.create_job(
|
||||
result = job_manager.create_job(
|
||||
config_path=config_path,
|
||||
date_range=all_dates,
|
||||
models=models_to_run,
|
||||
model_day_filter=None # Worker will filter based on available data
|
||||
)
|
||||
job_id = result["job_id"]
|
||||
warnings = result.get("warnings", [])
|
||||
|
||||
# Log warnings if any simulations were skipped
|
||||
if warnings:
|
||||
logger.warning(f"Job {job_id} created with {len(warnings)} skipped simulations: {warnings}")
|
||||
|
||||
# Start worker in background thread (only if not in test mode)
|
||||
if not getattr(app.state, "test_mode", False):
|
||||
|
||||
Reference in New Issue
Block a user