feat: add image-proxy key ttl and shared http dispatcher

This commit is contained in:
copilot-swe-agent[bot] authored and GitHub committed 2026-06-03 06:01:34 +00:00
1 parent 3ff0d72ba1
commit e1ff84830f
3 files changed
+69 -11

No files matched your search

+8 -2
View File
@@ -113,8 +113,14 @@ export const createGetSetChannel = <TData>(name: string) => {
* Set data in the channel
* @param data data to be stored in the channel
*/
setAsync: async (data: TData) => {
await getSetClient.set(name, superjson.stringify(data));
setAsync: async (data: TData, options?: { ttlSeconds?: number }) => {
const ttlSeconds = options?.ttlSeconds;
const serializedData = superjson.stringify(data);
if (ttlSeconds && ttlSeconds > 0) {
await getSetClient.set(name, serializedData, "EX", Math.ceil(ttlSeconds));
return;
}
await getSetClient.set(name, serializedData);
},
/**
* Remove data from the channel