Add failsafes

This commit is contained in:
zkldi
2021-10-23 01:33:22 +01:00
parent 1ac967f492
commit bde44bacf1
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -171,5 +171,6 @@ export const Environment = {
port,
redisUrl,
mongoUrl,
cdnRoot,
// If node_env is test, force to ./test-cdn.
cdnRoot: process.env.NODE_ENV === "test" ? "./test-cdn" : cdnRoot,
};
+1 -1
View File
@@ -79,7 +79,7 @@ export default async function ResetDBState() {
export function ResetCDN() {
return new Promise<void>((resolve, reject) =>
rimraf(ServerConfig.CDN_FILE_ROOT, (err) => {
rimraf(Environment.cdnRoot, (err) => {
if (err) {
reject(err);
}