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
@@ -129,14 +129,13 @@ export const createGetSetChannel = <TData>(name: string) => {
|
||||
};
|
||||
|
||||
const queryCacheKey = (userId: string, boardId: string) => `qc:${userId}:${boardId}`;
|
||||
const queryCacheMaxValueBytes = 1024 * 1024;
|
||||
|
||||
export const setQueryCacheAsync = async (userId: string, boardId: string, value: string, ttlMs: number) => {
|
||||
if (Buffer.byteLength(value, "utf8") > queryCacheMaxValueBytes) {
|
||||
export const setQueryCacheAsync = async (userId: string, boardId: string, value: string, ttlMs: number, maxValueBytes: number) => {
|
||||
if (Buffer.byteLength(value, "utf8") > maxValueBytes) {
|
||||
logger.warn("Query cache value exceeded maximum size", {
|
||||
key: queryCacheKey(userId, boardId),
|
||||
valueBytes: Buffer.byteLength(value, "utf8"),
|
||||
maxValueBytes: queryCacheMaxValueBytes,
|
||||
maxValueBytes,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user