diff --git a/src/kv/redis-store.ts b/src/kv/redis-store.ts index e2536369..27342f83 100644 --- a/src/kv/redis-store.ts +++ b/src/kv/redis-store.ts @@ -1,5 +1,8 @@ import { createClient } from 'redis'; import { KvStore, SetOptions } from './abstract-store.js'; +import dbg from 'debug'; + +const debug = dbg('redis-store'); type RedisConnection = ReturnType; @@ -21,6 +24,7 @@ export class RedisKvStore extends KvStore { */ async get(key: string): Promise { + debug('Returning %s', key); const val = await this.redis.get(key); if (val===null) return null; return JSON.parse(val); @@ -32,6 +36,7 @@ export class RedisKvStore extends KvStore { */ async set(key: string, value: any, options?: SetOptions): Promise { + debug('Storing %s', key); if (options?.ttl) { const newTtl = Math.floor(options.ttl / 1000); await this.redis.setEx( @@ -52,6 +57,7 @@ export class RedisKvStore extends KvStore { */ async delete(key: string): Promise { + debug('Deleting: %s', key); await this.redis.del(key); } diff --git a/src/kv/service.ts b/src/kv/service.ts index 52a439b5..c5582b5c 100644 --- a/src/kv/service.ts +++ b/src/kv/service.ts @@ -52,7 +52,7 @@ export function getSessionStore(): SessionStore { }, delete: (id: string): Promise => { - return store.delete(id); + return store.delete('a12n:session:' + id); }, newSessionId() {