fixed up workers

This commit is contained in:
Boki 2025-06-24 13:27:43 -04:00
parent 60d7de1da8
commit f41622e530
5 changed files with 30 additions and 8 deletions

View file

@ -305,9 +305,22 @@ export class RedisCache implements CacheProvider {
return null;
}
this.updateStats(true);
const parsed = JSON.parse(value);
this.logger.debug('Cache raw get hit', { key });
return parsed;
try {
const parsed = JSON.parse(value);
this.logger.debug('Cache raw get hit', { key });
return parsed;
} catch (error) {
// If JSON parsing fails, log the error with more context
this.logger.warn('Cache getRaw JSON parse failed', {
key,
valueLength: value.length,
valuePreview: value.substring(0, 100),
error: error instanceof Error ? error.message : String(error)
});
// Return the raw value as-is if it can't be parsed
return value as unknown as T;
}
},
null,
'getRaw'