From 5abb9fbbd12e7097e348d6a38622d364b1fa47ed Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 10 Jan 2019 15:39:51 +0100 Subject: Add ability to unfederate a local video (on blacklist) --- shared/utils/server/servers.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'shared/utils/server/servers.ts') diff --git a/shared/utils/server/servers.ts b/shared/utils/server/servers.ts index 568385a41..1e9c83c72 100644 --- a/shared/utils/server/servers.ts +++ b/shared/utils/server/servers.ts @@ -145,8 +145,12 @@ function runServer (serverNumber: number, configOverride?: Object, args = []) { if (dontContinue === true) return server.app.stdout.removeListener('data', onStdout) + + process.on('exit', () => process.kill(server.app.pid)) + res(server) }) + }) } -- cgit v1.2.3 From dc094603cd9eccce3243a6b6ccec3416491f59d2 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 17 Jan 2019 11:23:40 +0100 Subject: Fix tests --- shared/utils/server/servers.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'shared/utils/server/servers.ts') diff --git a/shared/utils/server/servers.ts b/shared/utils/server/servers.ts index 1e9c83c72..cb57e0a69 100644 --- a/shared/utils/server/servers.ts +++ b/shared/utils/server/servers.ts @@ -146,7 +146,11 @@ function runServer (serverNumber: number, configOverride?: Object, args = []) { server.app.stdout.removeListener('data', onStdout) - process.on('exit', () => process.kill(server.app.pid)) + process.on('exit', () => { + try { + process.kill(server.app.pid) + } catch { /* empty */ } + }) res(server) }) -- cgit v1.2.3 From 092092969633bbcf6d4891a083ea497a7d5c3154 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 29 Jan 2019 08:37:25 +0100 Subject: Add hls support on server --- shared/utils/server/servers.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'shared/utils/server/servers.ts') diff --git a/shared/utils/server/servers.ts b/shared/utils/server/servers.ts index cb57e0a69..bde7dd5c2 100644 --- a/shared/utils/server/servers.ts +++ b/shared/utils/server/servers.ts @@ -166,9 +166,13 @@ async function reRunServer (server: ServerInfo, configOverride?: any) { } async function checkTmpIsEmpty (server: ServerInfo) { + return checkDirectoryIsEmpty(server, 'tmp') +} + +async function checkDirectoryIsEmpty (server: ServerInfo, directory: string) { const testDirectory = 'test' + server.serverNumber - const directoryPath = join(root(), testDirectory, 'tmp') + const directoryPath = join(root(), testDirectory, directory) const directoryExists = existsSync(directoryPath) expect(directoryExists).to.be.true @@ -199,6 +203,7 @@ async function waitUntilLog (server: ServerInfo, str: string, count = 1) { // --------------------------------------------------------------------------- export { + checkDirectoryIsEmpty, checkTmpIsEmpty, ServerInfo, flushAndRunMultipleServers, -- cgit v1.2.3