blob: 63cbb0a68c975074522dcbf0549b8c5a41d8642c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
import { Resource } from "@opencode-ai/console-resource"
export function createStickyTracker(stickyProvider: boolean, session: string) {
if (!stickyProvider) return
if (!session) return
const key = `sticky:${session}`
return {
get: async () => {
return await Resource.GatewayKv.get(key)
},
set: async (providerId: string) => {
await Resource.GatewayKv.put(key, providerId, { expirationTtl: 86400 })
},
}
}
|