refactor: simplify request handlers and deduplicate config
- Re-enable TanStack Query retry (retry: 3 with exponential backoff), delete all server-side retry logic from request handlers - Strip handler factories to bare minimum: remove isValid, retry, widgetKind - Remove redundant refetchOnWindowFocus/refetchOnReconnect from docker-table - Deduplicate queryCacheMaxValueBytes (pass as param, single source of truth) - Simplify system-resources chart: use dataUpdatedAt instead of ref-based tracking - Fix leading blank lines in 27 request handler files
This commit is contained in:
15 files changed
+36
-114
No files matched your search
@@ -25,7 +25,7 @@ export const queryCacheRouter = createTRPCRouter({
|
||||
await validateBoardAccessAsync(ctx, input.boardId);
|
||||
const userId = ctx.session?.user.id ?? "anonymous";
|
||||
return {
|
||||
stored: await setQueryCacheAsync(userId, input.boardId, input.value, queryCacheDefaultGcTimeMs),
|
||||
stored: await setQueryCacheAsync(userId, input.boardId, input.value, queryCacheDefaultGcTimeMs, queryCacheMaxValueBytes),
|
||||
};
|
||||
}),
|
||||
removeItem: publicProcedure.input(queryCacheBoardInput).mutation(async ({ ctx, input }) => {
|
||||
|
||||
@@ -19,8 +19,8 @@ const redisMock = vi.hoisted(() => {
|
||||
|
||||
return {
|
||||
values,
|
||||
setQueryCacheAsync: vi.fn(async (_userId: string, _boardId: string, value: string, _ttlMs: number) => {
|
||||
if (Buffer.byteLength(value, "utf8") > 1024 * 1024) return false;
|
||||
setQueryCacheAsync: vi.fn(async (_userId: string, _boardId: string, value: string, _ttlMs: number, maxValueBytes: number) => {
|
||||
if (Buffer.byteLength(value, "utf8") > maxValueBytes) return false;
|
||||
values.set(`${_userId}:${_boardId}`, value);
|
||||
return true;
|
||||
}),
|
||||
|
||||
Reference in new issue
Block a user