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

Function ensureBackground

apps/sim/lib/monitoring/metrics.ts:69–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67}
68
69function ensureBackground(): void {
70 if (timer) return
71 timer = setInterval(() => {
72 void flushHostedKeyMetrics()
73 }, FLUSH_INTERVAL_MS)
74 timer.unref?.()
75 if (!handlersRegistered) {
76 handlersRegistered = true
77 const onExit = async () => {
78 await flushHostedKeyMetrics()
79 }
80 process.once('SIGTERM', onExit)
81 process.once('SIGINT', onExit)
82 process.once('beforeExit', onExit)
83 }
84}
85
86function buildDimensions(labels: Record<string, string | undefined>) {
87 const dimensions = [{ Name: 'Environment', Value: ENVIRONMENT }]

Callers 1

enqueueFunction · 0.85

Calls 1

flushHostedKeyMetricsFunction · 0.85

Tested by

no test coverage detected