MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / defaultTimeoutForScope

Function defaultTimeoutForScope

apps/web/src/routers/usage-analytics-router.ts:483–487  ·  view source on GitHub ↗
(scope: 'user' | 'org' | 'admin')

Source from the content-addressed store, hash-verified

481 * Returns a SQL expression that formats the time column as a string bucket,
482 * matching the granularity the caller requested.
483 *
484 * Hourly → 'YYYY-MM-DD HH24:MI:SS' (matches what Postgres timestamp::text returns)
485 * Day → 'YYYY-MM-DD'
486 * Week → 'YYYY-MM-DD' of the Monday-aligned week start
487 * Month → 'YYYY-MM-DD' of the first of the month (from daily table)
488 */
489function bucketExprSql(effectiveGranularity: Granularity, tier: GranularityTier): string {
490 const timeCol = getTimeColumn(tier);

Callers 2

timedSnowflakeQueryFunction · 0.70

Calls 1

parseTimeoutEnvFunction · 0.70

Tested by

no test coverage detected