MCPcopy Create free account
hub / github.com/Noumena-Network/code / triggerFastModeCooldown

Function triggerFastModeCooldown

src/utils/fastMode.ts:215–234  ·  view source on GitHub ↗
(
  resetTimestamp: number,
  reason: CooldownReason,
)

Source from the content-addressed store, hash-verified

213}
214
215export function triggerFastModeCooldown(
216 resetTimestamp: number,
217 reason: CooldownReason,
218): void {
219 if (!isFastModeEnabled()) {
220 return
221 }
222 runtimeState = { status: 'cooldown', resetAt: resetTimestamp, reason }
223 hasLoggedCooldownExpiry = false
224 const cooldownDurationMs = resetTimestamp - Date.now()
225 logForDebugging(
226 `Fast mode cooldown triggered (${reason}), duration ${Math.round(cooldownDurationMs / 1000)}s`,
227 )
228 logEvent('ncode_fast_mode_fallback_triggered', {
229 cooldown_duration_ms: cooldownDurationMs,
230 cooldown_reason:
231 reason as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
232 })
233 cooldownTriggered.emit(resetTimestamp, reason)
234}
235
236export function clearFastModeCooldown(): void {
237 runtimeState = { status: 'active' }

Callers 1

withRetryFunction · 0.85

Calls 4

isFastModeEnabledFunction · 0.85
emitMethod · 0.80
logForDebuggingFunction · 0.70
logEventFunction · 0.50

Tested by

no test coverage detected