fix: Remove DisableConcurrentExecution to enable internal parallelization

Rationale:
- DisableConcurrentExecution(timeoutInSeconds: 1800) was blocking Hangfire
  from running parallel workloads, preventing Parallel.ForEachAsync from
  having effect
- Phase 1 Shadow Run uses internal Parallel.ForEachAsync for API calls,
  JSON parsing, and ticker processing
- Removing this Job-level lock allows the 3-layer parallelization to work:
  1. 10 concurrent API calls (vs 252 sequential)
  2. 4-thread JSON parsing (vs single-threaded)
  3. 5 concurrent ticker processing

Expected improvement: 60min → ~20min (66% reduction)

Compliance: AGENTS.md v16.0 #6 (Simplicity), #12 (Right Way)
Addressed: DEBT-017 (DisableConcurrentExecution blocks parallelization)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-08-14 16:40:58 +09:00
parent 1fb8775756
commit 9342e5e6df
+1 -1
View File
@@ -76,7 +76,7 @@ public sealed class ShadowRunJob(
"Shadow run {RunId} phase 4 (phase segmentation) complete");
[Queue("q-evaluation")]
[DisableConcurrentExecution(timeoutInSeconds: 1800)] // 30 min for bulk historical (252+ days)
// [DisableConcurrentExecution(timeoutInSeconds: 1800)] // REMOVED: Allows internal parallel operations (Parallel.ForEachAsync)
[AutomaticRetry(Attempts = MaxAttempts, OnAttemptsExceeded = AttemptsExceededAction.Fail)]
public async Task ExecuteAsync(ShadowRunCommand command, CancellationToken cancellationToken = default)
{