From 313ee7cfd4cf9f674306703fd3510b978fc74587 Mon Sep 17 00:00:00 2001 From: Matthieu Bessat Date: Wed, 5 Aug 2020 14:50:52 +0200 Subject: [PATCH] feat: add twig cache env var --- .env.example | 2 ++ src/app.ts | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 5f663ce..615c806 100644 --- a/.env.example +++ b/.env.example @@ -21,3 +21,5 @@ BASE_URL=http://srv.espacecondorcet.org:8001 WEB_UI_URL=http://localhost:8080 MOCK_EMAIL=false + +DISABLE_TWIG_CACHE=false diff --git a/src/app.ts b/src/app.ts index bc0c879..379f10e 100644 --- a/src/app.ts +++ b/src/app.ts @@ -33,7 +33,9 @@ const app: express.Application = express() const host: string = process.env.HOST === undefined ? '127.0.0.1' : process.env.HOST const port: number = 8001 -twig.cache(false) +if (process.env.DISABLE_TWIG_CACHE === 'true') { + twig.cache(false) +} let main = async () => { EmailService.init()