diff options
Diffstat (limited to 'server.ts')
-rw-r--r-- | server.ts | 16 |
1 files changed, 5 insertions, 11 deletions
@@ -46,7 +46,7 @@ db.init(false).then(() => onDatabaseInitDone()) | |||
46 | 46 | ||
47 | // ----------- PeerTube modules ----------- | 47 | // ----------- PeerTube modules ----------- |
48 | import { migrate, installApplication } from './server/initializers' | 48 | import { migrate, installApplication } from './server/initializers' |
49 | import { JobScheduler, activateSchedulers, VideosPreviewCache } from './server/lib' | 49 | import { httpRequestJobScheduler, transcodingJobScheduler, VideosPreviewCache } from './server/lib' |
50 | import { apiRouter, clientsRouter, staticRouter, servicesRouter } from './server/controllers' | 50 | import { apiRouter, clientsRouter, staticRouter, servicesRouter } from './server/controllers' |
51 | 51 | ||
52 | // ----------- Command line ----------- | 52 | // ----------- Command line ----------- |
@@ -146,19 +146,13 @@ function onDatabaseInitDone () { | |||
146 | const port = CONFIG.LISTEN.PORT | 146 | const port = CONFIG.LISTEN.PORT |
147 | // Run the migration scripts if needed | 147 | // Run the migration scripts if needed |
148 | migrate() | 148 | migrate() |
149 | .then(() => { | 149 | .then(() => installApplication()) |
150 | return installApplication() | ||
151 | }) | ||
152 | .then(() => { | 150 | .then(() => { |
153 | // ----------- Make the server listening ----------- | 151 | // ----------- Make the server listening ----------- |
154 | server.listen(port, function () { | 152 | server.listen(port, () => { |
155 | // Activate the communication with friends | ||
156 | activateSchedulers() | ||
157 | |||
158 | // Activate job scheduler | ||
159 | JobScheduler.Instance.activate() | ||
160 | |||
161 | VideosPreviewCache.Instance.init(CONFIG.CACHE.PREVIEWS.SIZE) | 153 | VideosPreviewCache.Instance.init(CONFIG.CACHE.PREVIEWS.SIZE) |
154 | httpRequestJobScheduler.activate() | ||
155 | transcodingJobScheduler.activate() | ||
162 | 156 | ||
163 | logger.info('Server listening on port %d', port) | 157 | logger.info('Server listening on port %d', port) |
164 | logger.info('Web server: %s', CONFIG.WEBSERVER.URL) | 158 | logger.info('Web server: %s', CONFIG.WEBSERVER.URL) |