(options: SchedulerOptions)
| 61 | } |
| 62 | |
| 63 | export function initScheduler(options: SchedulerOptions): void { |
| 64 | if (initialized) return |
| 65 | initialized = true |
| 66 | |
| 67 | _dsManager = options.dsManager |
| 68 | _pullEngine = options.pullEngine |
| 69 | _logger = options.logger ?? NOOP_LOGGER |
| 70 | |
| 71 | const sources = _dsManager.loadAll() |
| 72 | for (const ds of sources) { |
| 73 | if (ds.enabled && ds.sessions.length > 0) { |
| 74 | startTimer(ds) |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | _logger.info(`[Pull] Initialized with ${sources.filter((s) => s.enabled).length} active sources`) |
| 79 | } |
| 80 | |
| 81 | export function stopAllTimers(): void { |
| 82 | for (const [id] of timers) { |
no test coverage detected