{"record":{"id":"01055731c5694bd2","repo":"diegosouzapw/OmniRoute","slug":"session-affinity-periodic-cleanup-failed","errorCode":null,"errorMessage":"[SESSION_AFFINITY] Periodic cleanup failed:","messagePattern":"\\[SESSION_AFFINITY\\] Periodic cleanup failed:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/db/sessionAccountAffinity.ts","lineNumber":202,"sourceCode":"\n  tx();\n  return deleted;\n}\n\nexport function startSessionAccountAffinityCleanup(): void {\n  if (cleanupTimer) return;\n\n  try {\n    cleanupStaleSessionAccountAffinities();\n  } catch (error) {\n    console.warn(\"[SESSION_AFFINITY] Startup cleanup failed:\", error);\n  }\n\n  cleanupTimer = setInterval(() => {\n    try {\n      cleanupStaleSessionAccountAffinities();\n    } catch (error) {\n      console.warn(\"[SESSION_AFFINITY] Periodic cleanup failed:\", error);\n    }\n  }, CLEANUP_INTERVAL_MS);\n  if (typeof cleanupTimer === \"object\" && \"unref\" in cleanupTimer) cleanupTimer.unref?.();\n}\n\nexport function stopSessionAccountAffinityCleanupForTests(): void {\n  if (!cleanupTimer) return;\n  clearInterval(cleanupTimer);\n  cleanupTimer = null;\n}\n","sourceCodeStart":184,"sourceCodeEnd":213,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/db/sessionAccountAffinity.ts#L184-L213","documentation":"Error \"[SESSION_AFFINITY] Periodic cleanup failed:\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/db/sessionAccountAffinity.ts:202 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}