diff options
Diffstat (limited to 'server.ts')
-rw-r--r-- | server.ts | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -53,9 +53,11 @@ migrate() | |||
53 | 53 | ||
54 | // ----------- PeerTube modules ----------- | 54 | // ----------- PeerTube modules ----------- |
55 | import { installApplication } from './server/initializers' | 55 | import { installApplication } from './server/initializers' |
56 | import { Emailer } from './server/lib/emailer' | ||
56 | import { JobQueue } from './server/lib/job-queue' | 57 | import { JobQueue } from './server/lib/job-queue' |
57 | import { VideosPreviewCache } from './server/lib/cache' | 58 | import { VideosPreviewCache } from './server/lib/cache' |
58 | import { apiRouter, clientsRouter, staticRouter, servicesRouter, webfingerRouter, activityPubRouter } from './server/controllers' | 59 | import { apiRouter, clientsRouter, staticRouter, servicesRouter, webfingerRouter, activityPubRouter } from './server/controllers' |
60 | import { Redis } from './server/lib/redis' | ||
59 | import { BadActorFollowScheduler } from './server/lib/schedulers/bad-actor-follow-scheduler' | 61 | import { BadActorFollowScheduler } from './server/lib/schedulers/bad-actor-follow-scheduler' |
60 | import { RemoveOldJobsScheduler } from './server/lib/schedulers/remove-old-jobs-scheduler' | 62 | import { RemoveOldJobsScheduler } from './server/lib/schedulers/remove-old-jobs-scheduler' |
61 | 63 | ||
@@ -169,10 +171,20 @@ function onDatabaseInitDone () { | |||
169 | .then(() => { | 171 | .then(() => { |
170 | // ----------- Make the server listening ----------- | 172 | // ----------- Make the server listening ----------- |
171 | server.listen(port, () => { | 173 | server.listen(port, () => { |
174 | // Emailer initialization and then job queue initialization | ||
175 | Emailer.Instance.init() | ||
176 | Emailer.Instance.checkConnectionOrDie() | ||
177 | .then(() => JobQueue.Instance.init()) | ||
178 | |||
179 | // Caches initializations | ||
172 | VideosPreviewCache.Instance.init(CONFIG.CACHE.PREVIEWS.SIZE) | 180 | VideosPreviewCache.Instance.init(CONFIG.CACHE.PREVIEWS.SIZE) |
181 | |||
182 | // Enable Schedulers | ||
173 | BadActorFollowScheduler.Instance.enable() | 183 | BadActorFollowScheduler.Instance.enable() |
174 | RemoveOldJobsScheduler.Instance.enable() | 184 | RemoveOldJobsScheduler.Instance.enable() |
175 | JobQueue.Instance.init() | 185 | |
186 | // Redis initialization | ||
187 | Redis.Instance.init() | ||
176 | 188 | ||
177 | logger.info('Server listening on port %d', port) | 189 | logger.info('Server listening on port %d', port) |
178 | logger.info('Web server: %s', CONFIG.WEBSERVER.URL) | 190 | logger.info('Web server: %s', CONFIG.WEBSERVER.URL) |