logging
This commit is contained in:
8
lib/services/cache/redis-cache-service.ts
vendored
8
lib/services/cache/redis-cache-service.ts
vendored
@@ -1,5 +1,6 @@
|
||||
import { createClient, type RedisClientType } from 'redis';
|
||||
import type { CacheService, CacheSetOptions } from './cache-service';
|
||||
import { getServerAppServices } from '../create-services.server';
|
||||
|
||||
export type RedisCacheServiceOptions = {
|
||||
url: string;
|
||||
@@ -17,7 +18,12 @@ export class RedisCacheService implements CacheService {
|
||||
this.keyPrefix = options.keyPrefix ?? '';
|
||||
|
||||
// Fire-and-forget connect.
|
||||
this.client.connect().catch(() => undefined);
|
||||
this.client.connect().catch((err) => {
|
||||
// We can't use getServerAppServices() here because it might cause a circular dependency
|
||||
// during initialization. But we can log to console as a fallback or use a global logger if we had one.
|
||||
// For now, let's just use console.error as this is a low-level service.
|
||||
console.error('Redis connection error:', err);
|
||||
});
|
||||
}
|
||||
|
||||
private k(key: string) {
|
||||
|
||||
Reference in New Issue
Block a user