fix #1095: make PDF_DELETION_TIME optional, add default value

This commit is contained in:
Amruth Pillai
2022-11-23 11:51:28 +01:00
parent 6bd7b9a50f
commit d1a1b68302
3 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,5 @@
import { registerAs } from '@nestjs/config';
export default registerAs('cache', () => ({
pdfDeletionTime: parseInt(process.env.PDF_DELETION_TIME, 10),
pdfDeletionTime: parseInt(process.env.PDF_DELETION_TIME, 10) || 4 * 24 * 60 * 60 * 1000, // 4 days
}));

View File

@ -55,7 +55,9 @@ const validationSchema = Joi.object({
STORAGE_SECRET_KEY: Joi.string().allow(''),
// Cache
PDF_DELETION_TIME: Joi.number().default(4 * 24 * 60 * 60 * 1000), // 4 days
PDF_DELETION_TIME: Joi.number()
.default(4 * 24 * 60 * 60 * 1000) // 4 days
.allow(''),
});
@Module({