aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/initializers/installer.ts6
-rw-r--r--server/tests/api/users/users-multiple-servers.ts7
2 files changed, 11 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
44function removeCacheDirectories () { 44function 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
diff --git a/server/tests/api/users/users-multiple-servers.ts b/server/tests/api/users/users-multiple-servers.ts
index 006d6cdf0..c46c2b7d7 100644
--- a/server/tests/api/users/users-multiple-servers.ts
+++ b/server/tests/api/users/users-multiple-servers.ts
@@ -4,6 +4,7 @@ import * as chai from 'chai'
4import 'mocha' 4import 'mocha'
5import { Account } from '../../../../shared/models/actors' 5import { Account } from '../../../../shared/models/actors'
6import { 6import {
7 checkTmpIsEmpty,
7 checkVideoFilesWereRemoved, 8 checkVideoFilesWereRemoved,
8 createUser, 9 createUser,
9 doubleFollow, 10 doubleFollow,
@@ -216,6 +217,12 @@ describe('Test users with multiple servers', function () {
216 } 217 }
217 }) 218 })
218 219
220 it('Should have an empty tmp directory', async function () {
221 for (const server of servers) {
222 await checkTmpIsEmpty(server)
223 }
224 })
225
219 after(async function () { 226 after(async function () {
220 killallServers(servers) 227 killallServers(servers)
221 }) 228 })