add 30 days ttl

This commit is contained in:
JannikStreek 2022-05-26 13:41:51 +02:00 committed by GitHub
parent 1086b69595
commit 51db573030
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,7 @@ export class StorageService {
constructor() {
const uri = process.env[`STORAGE_URI`];
const ttl = 2592000; // 30 days
if (!uri) {
this.logger.warn(
`STORAGE_URI is undefined, will use non persistant in memory storage`,
@ -18,6 +19,7 @@ export class StorageService {
const keyv = new Keyv({
uri,
namespace,
ttl,
});
keyv.on('error', (err) =>
this.logger.error(`Connection Error for namespace ${namespace}`, err),