diff options
Diffstat (limited to 'shared/extra-utils/server')
-rw-r--r-- | shared/extra-utils/server/debug.ts | 18 | ||||
-rw-r--r-- | shared/extra-utils/server/servers.ts | 2 |
2 files changed, 17 insertions, 3 deletions
diff --git a/shared/extra-utils/server/debug.ts b/shared/extra-utils/server/debug.ts index 5cf80a5fb..f196812b7 100644 --- a/shared/extra-utils/server/debug.ts +++ b/shared/extra-utils/server/debug.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | import { makeGetRequest } from '../requests/requests' | 1 | import { makeGetRequest, makePostBodyRequest } from '../requests/requests' |
2 | import { HttpStatusCode } from '../../core-utils/miscs/http-error-codes' | 2 | import { HttpStatusCode } from '../../core-utils/miscs/http-error-codes' |
3 | import { SendDebugCommand } from '@shared/models' | ||
3 | 4 | ||
4 | function getDebug (url: string, token: string) { | 5 | function getDebug (url: string, token: string) { |
5 | const path = '/api/v1/server/debug' | 6 | const path = '/api/v1/server/debug' |
@@ -12,8 +13,21 @@ function getDebug (url: string, token: string) { | |||
12 | }) | 13 | }) |
13 | } | 14 | } |
14 | 15 | ||
16 | function sendDebugCommand (url: string, token: string, body: SendDebugCommand) { | ||
17 | const path = '/api/v1/server/debug/run-command' | ||
18 | |||
19 | return makePostBodyRequest({ | ||
20 | url, | ||
21 | path, | ||
22 | token, | ||
23 | fields: body, | ||
24 | statusCodeExpected: HttpStatusCode.NO_CONTENT_204 | ||
25 | }) | ||
26 | } | ||
27 | |||
15 | // --------------------------------------------------------------------------- | 28 | // --------------------------------------------------------------------------- |
16 | 29 | ||
17 | export { | 30 | export { |
18 | getDebug | 31 | getDebug, |
32 | sendDebugCommand | ||
19 | } | 33 | } |
diff --git a/shared/extra-utils/server/servers.ts b/shared/extra-utils/server/servers.ts index 779a3cc36..479f08e12 100644 --- a/shared/extra-utils/server/servers.ts +++ b/shared/extra-utils/server/servers.ts | |||
@@ -274,7 +274,7 @@ async function reRunServer (server: ServerInfo, configOverride?: any) { | |||
274 | } | 274 | } |
275 | 275 | ||
276 | async function checkTmpIsEmpty (server: ServerInfo) { | 276 | async function checkTmpIsEmpty (server: ServerInfo) { |
277 | await checkDirectoryIsEmpty(server, 'tmp', [ 'plugins-global.css', 'hls' ]) | 277 | await checkDirectoryIsEmpty(server, 'tmp', [ 'plugins-global.css', 'hls', 'resumable-uploads' ]) |
278 | 278 | ||
279 | if (await pathExists(join('test' + server.internalServerNumber, 'tmp', 'hls'))) { | 279 | if (await pathExists(join('test' + server.internalServerNumber, 'tmp', 'hls'))) { |
280 | await checkDirectoryIsEmpty(server, 'tmp/hls') | 280 | await checkDirectoryIsEmpty(server, 'tmp/hls') |