MCPcopy Create free account
hub / github.com/electric-sql/electric / parseCronStreamPath

Function parseCronStreamPath

packages/agents-runtime/src/cron-utils.ts:115–129  ·  view source on GitHub ↗
(
  streamPath: string,
  opts?: { fallback?: TimezoneFallback }
)

Source from the content-addressed store, hash-verified

113}
114
115export function parseCronStreamPath(
116 streamPath: string,
117 opts?: { fallback?: TimezoneFallback }
118): CronScheduleSpec {
119 if (!streamPath.startsWith(CRON_STREAM_PREFIX)) {
120 throw new Error(`Invalid cron stream path: ${streamPath}`)
121 }
122
123 const encoded = streamPath.slice(CRON_STREAM_PREFIX.length)
124 if (!encoded) {
125 throw new Error(`Invalid cron stream path: ${streamPath}`)
126 }
127
128 return decodeCronScheduleSpec(encoded, opts)
129}
130
131export function getNextCronFireAt(
132 expression: string,

Callers 2

executeCronTickMethod · 0.90

Calls 2

decodeCronScheduleSpecFunction · 0.85
sliceMethod · 0.45

Tested by

no test coverage detected