mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-10 16:28:17 +03:00
Add failsafes
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user