refactor(monitoring): consolidate workers and extract to scheduler process
Remove standalone lease-recovery, received-inspection, and result-recovery workers from tenant-api (now handled by scheduler process). Add configurable concurrency to ingest and projection-rebuild workers via MonitoringWorkers runtime config. Extract shared runtime types for worker configuration. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,8 @@ type monitoringStaleReceivedTask struct {
|
||||
CallbackReceivedAt time.Time
|
||||
}
|
||||
|
||||
type MonitoringStaleReceivedTask = monitoringStaleReceivedTask
|
||||
|
||||
func markMonitoringStaleReceivedTasks(ctx context.Context, tx pgx.Tx, now time.Time, threshold time.Duration, limit int) ([]monitoringStaleReceivedTask, error) {
|
||||
if limit <= 0 {
|
||||
limit = defaultMonitoringReceivedInspectLimit
|
||||
@@ -111,3 +113,11 @@ func markMonitoringStaleReceivedTasks(ctx context.Context, tx pgx.Tx, now time.T
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func MarkMonitoringStaleReceivedTasks(ctx context.Context, tx pgx.Tx, now time.Time, threshold time.Duration, limit int) ([]MonitoringStaleReceivedTask, error) {
|
||||
items, err := markMonitoringStaleReceivedTasks(ctx, tx, now, threshold, limit)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return items, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user