Skip to content

Commit

Permalink
extract globalScheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed Oct 5, 2024
1 parent 1a22a1d commit dc8bda1
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,3 @@ export const globalScheduler: Scheduler = {
"@type": "Scheduler",
jobs: [],
}

export function initializeScheduler(): Scheduler {
globalScheduler.jobs = []
return globalScheduler
}
2 changes: 1 addition & 1 deletion src/scheduler/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from "./initializeScheduler.js"
export * from "./globalScheduler.js"
export * from "./run.js"
export * from "./schedule.js"
export * from "./Scheduler.js"
2 changes: 1 addition & 1 deletion src/scheduler/run.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { globalScheduler } from "./globalScheduler.js"
import type { Job } from "./Scheduler.js"
import { globalScheduler } from "./initializeScheduler.js"

export async function run(): Promise<void> {
while (globalScheduler.jobs.length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/scheduler/schedule.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Propagator } from "../propagator/index.js"
import { globalScheduler } from "./initializeScheduler.js"
import { globalScheduler } from "./globalScheduler.js"

const allEverScheduledPropagators = new Set<Propagator>()

Expand Down

0 comments on commit dc8bda1

Please sign in to comment.