aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue
diff options
context:
space:
mode:
authorkontrollanten <6680299+kontrollanten@users.noreply.github.com>2021-11-09 11:05:35 +0100
committerGitHub <noreply@github.com>2021-11-09 11:05:35 +0100
commite1ab52d7ec7370a6f9f5937192d6003206af1ac0 (patch)
treeaecc8b696b0021e073fd205dd6e126fb4f178e8f /server/lib/job-queue
parentc49c366ac320fe5ac3dc08f5891fe5898c1b34e3 (diff)
downloadPeerTube-e1ab52d7ec7370a6f9f5937192d6003206af1ac0.tar.gz
PeerTube-e1ab52d7ec7370a6f9f5937192d6003206af1ac0.tar.zst
PeerTube-e1ab52d7ec7370a6f9f5937192d6003206af1ac0.zip
Add migrate-to-object-storage script (#4481)
* add migrate-to-object-storage-script closes #4467 * add migrate-to-unique-playlist-filenames script * fix(migrate-to-unique-playlist-filenames): update master/segments256 run updateMasterHLSPlaylist and updateSha256VODSegments after file rename. * Improve move to object storage scripts * PR remarks Co-authored-by: Chocobozzz <me@florianbigard.com>
Diffstat (limited to 'server/lib/job-queue')
-rw-r--r--server/lib/job-queue/job-queue.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/server/lib/job-queue/job-queue.ts b/server/lib/job-queue/job-queue.ts
index 53d6b6a9c..0eab720d9 100644
--- a/server/lib/job-queue/job-queue.ts
+++ b/server/lib/job-queue/job-queue.ts
@@ -108,7 +108,7 @@ class JobQueue {
108 private constructor () { 108 private constructor () {
109 } 109 }
110 110
111 init () { 111 init (produceOnly = false) {
112 // Already initialized 112 // Already initialized
113 if (this.initialized === true) return 113 if (this.initialized === true) return
114 this.initialized = true 114 this.initialized = true
@@ -124,6 +124,12 @@ class JobQueue {
124 124
125 for (const handlerName of (Object.keys(handlers) as JobType[])) { 125 for (const handlerName of (Object.keys(handlers) as JobType[])) {
126 const queue = new Bull(handlerName, queueOptions) 126 const queue = new Bull(handlerName, queueOptions)
127
128 if (produceOnly) {
129 queue.pause(true)
130 .catch(err => logger.error('Cannot pause queue %s in produced only job queue', handlerName, { err }))
131 }
132
127 const handler = handlers[handlerName] 133 const handler = handlers[handlerName]
128 134
129 queue.process(this.getJobConcurrency(handlerName), handler) 135 queue.process(this.getJobConcurrency(handlerName), handler)