aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/schedulers/update-videos-scheduler.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-12-20 14:31:11 +0100
committerChocobozzz <me@florianbigard.com>2018-12-20 14:31:11 +0100
commit2f5c6b2fc6e60502c2a8df4dc9029c1d87ebe30b (patch)
tree9b83f018403c30421c1b3ca4439c4dddc5077881 /server/lib/schedulers/update-videos-scheduler.ts
parent4707f410ae44b55e17e1758693dd21cff03b7ef1 (diff)
downloadPeerTube-2f5c6b2fc6e60502c2a8df4dc9029c1d87ebe30b.tar.gz
PeerTube-2f5c6b2fc6e60502c2a8df4dc9029c1d87ebe30b.tar.zst
PeerTube-2f5c6b2fc6e60502c2a8df4dc9029c1d87ebe30b.zip
Optimize actor follow scores modifications
Diffstat (limited to 'server/lib/schedulers/update-videos-scheduler.ts')
-rw-r--r--server/lib/schedulers/update-videos-scheduler.ts15
1 files changed, 2 insertions, 13 deletions
diff --git a/server/lib/schedulers/update-videos-scheduler.ts b/server/lib/schedulers/update-videos-scheduler.ts
index fd2edfd17..21f071f9e 100644
--- a/server/lib/schedulers/update-videos-scheduler.ts
+++ b/server/lib/schedulers/update-videos-scheduler.ts
@@ -12,23 +12,12 @@ export class UpdateVideosScheduler extends AbstractScheduler {
12 12
13 protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.updateVideos 13 protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.updateVideos
14 14
15 private isRunning = false
16
17 private constructor () { 15 private constructor () {
18 super() 16 super()
19 } 17 }
20 18
21 async execute () { 19 protected async internalExecute () {
22 if (this.isRunning === true) return 20 return retryTransactionWrapper(this.updateVideos.bind(this))
23 this.isRunning = true
24
25 try {
26 await retryTransactionWrapper(this.updateVideos.bind(this))
27 } catch (err) {
28 logger.error('Cannot execute update videos scheduler.', { err })
29 } finally {
30 this.isRunning = false
31 }
32 } 21 }
33 22
34 private async updateVideos () { 23 private async updateVideos () {