|
1 | 1 | import { ScheduleAlreadyRunning, ScheduleOverlapPolicy } from '@temporalio/client' |
2 | 2 |
|
3 | 3 | import { svc } from '../service' |
4 | | -import { |
5 | | - ingestRubyGemsCriticalDetails, |
6 | | - ingestRubyGemsDependents, |
7 | | - ingestRubyGemsPackages, |
8 | | -} from '../workflows' |
| 4 | +import { ingestRubyGemsCriticalDetails, ingestRubyGemsPackages } from '../workflows' |
9 | 5 |
|
10 | 6 | export async function scheduleRubyGemsIngestion(): Promise<void> { |
11 | 7 | const { temporal } = svc |
@@ -80,40 +76,3 @@ export async function scheduleRubyGemsCriticalIngestion(): Promise<void> { |
80 | 76 | } |
81 | 77 | } |
82 | 78 | } |
83 | | - |
84 | | -export async function scheduleRubyGemsDependentsIngestion(): Promise<void> { |
85 | | - const { temporal } = svc |
86 | | - if (!temporal) throw new Error('Temporal client not initialized') |
87 | | - |
88 | | - try { |
89 | | - await temporal.schedule.create({ |
90 | | - scheduleId: 'rubygems-dependents-ingest', |
91 | | - spec: { |
92 | | - cronExpressions: ['0 3 * * 0'], |
93 | | - }, |
94 | | - policies: { |
95 | | - overlap: ScheduleOverlapPolicy.SKIP, |
96 | | - catchupWindow: '1 hour', |
97 | | - }, |
98 | | - action: { |
99 | | - type: 'startWorkflow', |
100 | | - workflowType: ingestRubyGemsDependents, |
101 | | - workflowId: 'rubygems-weekly-dependents', |
102 | | - taskQueue: 'rubygems-worker', |
103 | | - workflowRunTimeout: '24 hours', |
104 | | - retry: { |
105 | | - initialInterval: '30 seconds', |
106 | | - backoffCoefficient: 2, |
107 | | - maximumAttempts: 5, |
108 | | - }, |
109 | | - args: [], |
110 | | - }, |
111 | | - }) |
112 | | - } catch (err) { |
113 | | - if (err instanceof ScheduleAlreadyRunning) { |
114 | | - svc.log.info('Schedule rubygems-dependents-ingest already exists, skipping creation.') |
115 | | - } else { |
116 | | - throw err |
117 | | - } |
118 | | - } |
119 | | -} |
0 commit comments