INNER CODE UNIT · TypeScript

defineCronJobs

modelence/modelence · packages/modelence/src/app/index.ts:329

function defineCronJobs(modules: Module[]) {
  for (const module of modules) {
    for (const [cronAlias, cronJobParams] of Object.entries(module.cronJobs)) {
      defineCronJob(`${module.name}.${cronAlias}`, cronJobParams);
    }
  }
}

function initStores(stores: Store<ModelSchema, never>[]) {
  const client = getClient();
  if (!client) {
    throw new Error('Failed to initialize stores: MongoDB client not initialized');
  }

  for (const store of stores) {
    store.init(client);
  }
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…