aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server.ts')
-rw-r--r--server.ts16
1 files changed, 5 insertions, 11 deletions
diff --git a/server.ts b/server.ts
index f50e5bad4..0878fe757 100644
--- a/server.ts
+++ b/server.ts
@@ -46,7 +46,7 @@ db.init(false).then(() => onDatabaseInitDone())
46 46
47// ----------- PeerTube modules ----------- 47// ----------- PeerTube modules -----------
48import { migrate, installApplication } from './server/initializers' 48import { migrate, installApplication } from './server/initializers'
49import { JobScheduler, activateSchedulers, VideosPreviewCache } from './server/lib' 49import { httpRequestJobScheduler, transcodingJobScheduler, VideosPreviewCache } from './server/lib'
50import { apiRouter, clientsRouter, staticRouter, servicesRouter } from './server/controllers' 50import { 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)