MCPcopy Index your code
hub / github.com/simstudioai/sim / pollNoActivityEvents

Function pollNoActivityEvents

apps/sim/lib/workspace-events/no-activity.ts:249–274  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

247 * never executed fires once, then respects the cooldown.
248 */
249export async function pollNoActivityEvents(): Promise<NoActivityPollResult> {
250 const result: NoActivityPollResult = { subscriptions: 0, checked: 0, fired: 0, skipped: 0 }
251
252 let cursor: string | null = null
253 while (true) {
254 const page = await fetchNoActivitySubscriptionPage(cursor)
255 if (page.length === 0) break
256
257 result.subscriptions += page.length
258 cursor = page[page.length - 1].webhook.id
259
260 for (const subscription of page) {
261 await checkSubscription(subscription, result)
262 }
263
264 if (page.length < NO_ACTIVITY_SUBSCRIPTION_PAGE_SIZE) break
265 }
266
267 if (result.subscriptions === 0) return result
268
269 logger.info(
270 `no_activity poll completed: ${result.fired} fired, ${result.skipped} skipped of ${result.checked} checked`
271 )
272
273 return result
274}

Callers 2

route.tsFile · 0.90

Calls 3

checkSubscriptionFunction · 0.85
infoMethod · 0.80

Tested by

no test coverage detected