From 9c1e37fedfcd6f8aaaeb64eac1845ee85e93ed1c Mon Sep 17 00:00:00 2001 From: Wildan M Date: Fri, 18 Oct 2024 08:05:19 +0700 Subject: [PATCH] Also prune cache when .env reload --- app.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 59dc88a..7606abc 100644 --- a/app.js +++ b/app.js @@ -1,4 +1,6 @@ -import {plainServer, secureServer} from "./index.js"; +import { plainServer, secureServer } from "./index.js"; +import { pruneCache as pruneCacheSni } from "./src/sni.js"; +import { pruneCache as pruneCacheClient } from "./src/client.js"; import { clearConfig } from "./src/util.js"; import fs from "fs"; import { watch } from "chokidar"; @@ -21,6 +23,8 @@ function reloadEnv() { watch('.env').on('change', () => { console.log('.env file changed, reloading...'); clearConfig(); + pruneCacheClient(); + pruneCacheSni(); reloadEnv(); });