diff options
author | Chocobozzz <me@florianbigard.com> | 2019-03-19 10:53:53 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-03-19 10:53:53 +0100 |
commit | f4800714f906eabd1762d42179e538f5c4a11d68 (patch) | |
tree | de5d46d49c257daab9d458d2cc88ee27618b87be /server/initializers | |
parent | dae86118ed5d4026d04acb9d0e36829b9ad8eb4e (diff) | |
download | PeerTube-f4800714f906eabd1762d42179e538f5c4a11d68.tar.gz PeerTube-f4800714f906eabd1762d42179e538f5c4a11d68.tar.zst PeerTube-f4800714f906eabd1762d42179e538f5c4a11d68.zip |
Cleanup tmp directory at startup
Diffstat (limited to 'server/initializers')
-rw-r--r-- | server/initializers/installer.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/initializers/installer.ts b/server/initializers/installer.ts index 349d7afb7..cd2c942fd 100644 --- a/server/initializers/installer.ts +++ b/server/initializers/installer.ts | |||
@@ -24,7 +24,7 @@ async function installApplication () { | |||
24 | }), | 24 | }), |
25 | 25 | ||
26 | // Directories | 26 | // Directories |
27 | removeCacheDirectories() | 27 | removeCacheAndTmpDirectories() |
28 | .then(() => createDirectoriesIfNotExist()) | 28 | .then(() => createDirectoriesIfNotExist()) |
29 | ]) | 29 | ]) |
30 | } catch (err) { | 30 | } catch (err) { |
@@ -41,7 +41,7 @@ export { | |||
41 | 41 | ||
42 | // --------------------------------------------------------------------------- | 42 | // --------------------------------------------------------------------------- |
43 | 43 | ||
44 | function removeCacheDirectories () { | 44 | function removeCacheAndTmpDirectories () { |
45 | const cacheDirectories = Object.keys(CACHE) | 45 | const cacheDirectories = Object.keys(CACHE) |
46 | .map(k => CACHE[k].DIRECTORY) | 46 | .map(k => CACHE[k].DIRECTORY) |
47 | 47 | ||
@@ -53,6 +53,8 @@ function removeCacheDirectories () { | |||
53 | tasks.push(remove(dir)) | 53 | tasks.push(remove(dir)) |
54 | } | 54 | } |
55 | 55 | ||
56 | tasks.push(remove(CONFIG.STORAGE.TMP_DIR)) | ||
57 | |||
56 | return Promise.all(tasks) | 58 | return Promise.all(tasks) |
57 | } | 59 | } |
58 | 60 | ||