diff --git a/src/repositories/MongoDBRepository.ts b/src/repositories/MongoDBRepository.ts index 436b6d5..a2c2a20 100644 --- a/src/repositories/MongoDBRepository.ts +++ b/src/repositories/MongoDBRepository.ts @@ -105,6 +105,7 @@ export class MongoDBRepository implements Repository { update: { $setOnInsert: { data: data, + created: Date.now(), }, }, upsert: true, diff --git a/src/repositories/RedisRepository.ts b/src/repositories/RedisRepository.ts index 18dd6d4..a3dae0a 100644 --- a/src/repositories/RedisRepository.ts +++ b/src/repositories/RedisRepository.ts @@ -92,6 +92,10 @@ export class RedisRepository implements Repository { `${this.data}:${encodeURIComponent(record.payload)}`, data, ), + this.client.set( + `${this.data}:${encodeURIComponent(record.payload)}:created`, + Date.now(), + ), ); }