INNER CODE UNIT · TypeScript

getRateLimits

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

function getRateLimits(modules: Module[]) {
  return modules.flatMap((module) => module.rateLimits);
}

function warnIndexCreationFailure(storeName: string, error: unknown) {
  console.warn(`Failed to create indexes for store '${storeName}'. Continuing startup.`, error);
}

const MIGRATIONS_LOCK_RESOURCE = 'migrations';

async function createIndexesAndMigrationsWithLock(
  effectiveStores: Store<ModelSchema, never>[],
  migrations: MigrationScript[]
) {
  const hasLock = await acquireLock(MIGRATIONS_LOCK_RESOURCE, {
    lockDuration: time.seconds(30),
    heartbeat: true,
  });

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…