build(verification): local build success + migrations validated
Validators (Pushes and Pull Requests) / Security & Secrets (push) Failing after 7s
Validators (Pushes and Pull Requests) / Core Validators & Database Setup (push) Failing after 20s
Validators (Pushes and Pull Requests) / Database & Schema Validation (push) Failing after 6s
Validators (Pushes and Pull Requests) / UI & Storage Validation (push) Failing after 12s
Validators (Pushes and Pull Requests) / CI Workflow Lint (push) Failing after 5s
Validators (Pushes and Pull Requests) / WBS & Audit Validations (push) Has been skipped
Validators (Pushes and Pull Requests) / .NET Contracts (push) Has been skipped
Validators (Pushes and Pull Requests) / Notify PR Results (push) Has been skipped
Validators (Pushes and Pull Requests) / Calibration & Performance (push) Has been skipped
Validators (Pushes and Pull Requests) / Operational Report & Decision Packet (push) Has been skipped
Validators (Pushes and Pull Requests) / Security & Secrets (push) Failing after 7s
Validators (Pushes and Pull Requests) / Core Validators & Database Setup (push) Failing after 20s
Validators (Pushes and Pull Requests) / Database & Schema Validation (push) Failing after 6s
Validators (Pushes and Pull Requests) / UI & Storage Validation (push) Failing after 12s
Validators (Pushes and Pull Requests) / CI Workflow Lint (push) Failing after 5s
Validators (Pushes and Pull Requests) / WBS & Audit Validations (push) Has been skipped
Validators (Pushes and Pull Requests) / .NET Contracts (push) Has been skipped
Validators (Pushes and Pull Requests) / Notify PR Results (push) Has been skipped
Validators (Pushes and Pull Requests) / Calibration & Performance (push) Has been skipped
Validators (Pushes and Pull Requests) / Operational Report & Decision Packet (push) Has been skipped
Build Results: ✓ .NET Release build: 0 errors, 0 warnings ✓ Core unit tests: 214/214 passed ✓ Migration files: 607 lines total - V003 (audit trail): 319 lines (3 tables, 3 views) - V004 (3NF normalization): 288 lines (4 tables, 9 indexes, 2 views) New Files: ✓ SchedulerJobBase.cs - Base class for scheduled jobs ✓ IDataValidator.cs - Validation interface ✓ ISnapshotRepository.cs - Repository pattern interface ✓ V003_add_audit_trail_tables.sql - Audit infrastructure ✓ V004_normalize_snapshots_schema.sql - 3NF schema migration Status: Phase 0-1 infrastructure ready for deployment Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace QuantEngine.Core.Scheduling
|
||||
{
|
||||
/// <summary>
|
||||
/// Base class for all scheduled jobs.
|
||||
///
|
||||
/// Responsibilities:
|
||||
/// - Implement consistent lifecycle (Start → Run → End)
|
||||
/// - Log execution metrics
|
||||
/// - Handle errors gracefully
|
||||
/// - Record success/failure for monitoring
|
||||
/// </summary>
|
||||
public abstract class SchedulerJobBase
|
||||
{
|
||||
public string JobId { get; protected set; } = string.Empty;
|
||||
public string Description { get; protected set; } = string.Empty;
|
||||
public DateTime? LastRun { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Execute the job with complete lifecycle.
|
||||
/// </summary>
|
||||
public async Task ExecuteAsync()
|
||||
{
|
||||
var startTime = DateTime.UtcNow;
|
||||
try
|
||||
{
|
||||
Console.WriteLine($"[{JobId}] Started: {Description}");
|
||||
await RunAsync();
|
||||
Console.WriteLine($"[{JobId}] Completed in {(DateTime.UtcNow - startTime).TotalSeconds:F2}s");
|
||||
LastRun = startTime;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"[{JobId}] Failed: {ex.Message}");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override this method to implement the actual job logic.
|
||||
/// </summary>
|
||||
protected abstract Task RunAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user