aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/server-commands/server/server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'shared/server-commands/server/server.ts')
-rw-r--r--shared/server-commands/server/server.ts20
1 files changed, 13 insertions, 7 deletions
diff --git a/shared/server-commands/server/server.ts b/shared/server-commands/server/server.ts
index d7e751581..f68b81367 100644
--- a/shared/server-commands/server/server.ts
+++ b/shared/server-commands/server/server.ts
@@ -8,9 +8,9 @@ import { CLICommand } from '../cli'
8import { CustomPagesCommand } from '../custom-pages' 8import { CustomPagesCommand } from '../custom-pages'
9import { FeedCommand } from '../feeds' 9import { FeedCommand } from '../feeds'
10import { LogsCommand } from '../logs' 10import { LogsCommand } from '../logs'
11import { SQLCommand } from '../miscs'
12import { AbusesCommand } from '../moderation' 11import { AbusesCommand } from '../moderation'
13import { OverviewsCommand } from '../overviews' 12import { OverviewsCommand } from '../overviews'
13import { RunnerJobsCommand, RunnerRegistrationTokensCommand, RunnersCommand } from '../runners'
14import { SearchCommand } from '../search' 14import { SearchCommand } from '../search'
15import { SocketIOCommand } from '../socket' 15import { SocketIOCommand } from '../socket'
16import { 16import {
@@ -136,7 +136,6 @@ export class PeerTubeServer {
136 streamingPlaylists?: StreamingPlaylistsCommand 136 streamingPlaylists?: StreamingPlaylistsCommand
137 channels?: ChannelsCommand 137 channels?: ChannelsCommand
138 comments?: CommentsCommand 138 comments?: CommentsCommand
139 sql?: SQLCommand
140 notifications?: NotificationsCommand 139 notifications?: NotificationsCommand
141 servers?: ServersCommand 140 servers?: ServersCommand
142 login?: LoginCommand 141 login?: LoginCommand
@@ -150,6 +149,10 @@ export class PeerTubeServer {
150 videoToken?: VideoTokenCommand 149 videoToken?: VideoTokenCommand
151 registrations?: RegistrationsCommand 150 registrations?: RegistrationsCommand
152 151
152 runners?: RunnersCommand
153 runnerRegistrationTokens?: RunnerRegistrationTokensCommand
154 runnerJobs?: RunnerJobsCommand
155
153 constructor (options: { serverNumber: number } | { url: string }) { 156 constructor (options: { serverNumber: number } | { url: string }) {
154 if ((options as any).url) { 157 if ((options as any).url) {
155 this.setUrl((options as any).url) 158 this.setUrl((options as any).url)
@@ -311,14 +314,14 @@ export class PeerTubeServer {
311 }) 314 })
312 } 315 }
313 316
314 async kill () { 317 kill () {
315 if (!this.app) return 318 if (!this.app) return Promise.resolve()
316
317 await this.sql.cleanup()
318 319
319 process.kill(-this.app.pid) 320 process.kill(-this.app.pid)
320 321
321 this.app = null 322 this.app = null
323
324 return Promise.resolve()
322 } 325 }
323 326
324 private randomServer () { 327 private randomServer () {
@@ -420,7 +423,6 @@ export class PeerTubeServer {
420 this.streamingPlaylists = new StreamingPlaylistsCommand(this) 423 this.streamingPlaylists = new StreamingPlaylistsCommand(this)
421 this.channels = new ChannelsCommand(this) 424 this.channels = new ChannelsCommand(this)
422 this.comments = new CommentsCommand(this) 425 this.comments = new CommentsCommand(this)
423 this.sql = new SQLCommand(this)
424 this.notifications = new NotificationsCommand(this) 426 this.notifications = new NotificationsCommand(this)
425 this.servers = new ServersCommand(this) 427 this.servers = new ServersCommand(this)
426 this.login = new LoginCommand(this) 428 this.login = new LoginCommand(this)
@@ -433,5 +435,9 @@ export class PeerTubeServer {
433 this.twoFactor = new TwoFactorCommand(this) 435 this.twoFactor = new TwoFactorCommand(this)
434 this.videoToken = new VideoTokenCommand(this) 436 this.videoToken = new VideoTokenCommand(this)
435 this.registrations = new RegistrationsCommand(this) 437 this.registrations = new RegistrationsCommand(this)
438
439 this.runners = new RunnersCommand(this)
440 this.runnerRegistrationTokens = new RunnerRegistrationTokensCommand(this)
441 this.runnerJobs = new RunnerJobsCommand(this)
436 } 442 }
437} 443}