@@ -0,0 +1,18 @@
|
||||
// SPDX-License-Identifier: LicenseRef-ConusAI-Template-1.0
|
||||
// The module cron of a mariadb or mongodb worker (G3j): the same declarations as the Postgres worker
|
||||
// (apps/worker/src/schedules.ts), kept to the modules that are installed on this profile. A schedule of a
|
||||
// module the profile does not ship (the agent module is Postgres-only) is left out, not scheduled to fail
|
||||
// every tick: the registry's repositories say which modules a profile has.
|
||||
|
||||
import type { DialectProfile } from "@app/config"
|
||||
import type { Registry } from "@conusai-kit/core"
|
||||
import type { ModuleSchedule } from "@conusai-kit/jobs-pgboss"
|
||||
import { appSchedules } from "../schedules.js"
|
||||
|
||||
export function dialectSchedules(
|
||||
registry: Registry,
|
||||
profile: DialectProfile,
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): readonly ModuleSchedule[] {
|
||||
return appSchedules(env).filter((schedule) => registry.repositories[schedule.module]?.[profile] !== undefined)
|
||||
}
|
||||
Reference in New Issue
Block a user