aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/schedulers/remove-old-jobs-scheduler.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-25 15:05:18 +0100
committerChocobozzz <me@florianbigard.com>2018-01-25 18:41:17 +0100
commit94a5ff8a4a75d75bb9df542a39ce8769e7a7e6a4 (patch)
tree32a9148e0e4567f0c4ffae0412cbed20b84e8873 /server/lib/schedulers/remove-old-jobs-scheduler.ts
parentd765fafc3faf0db9818eb1a07161df1cb1bc0efa (diff)
downloadPeerTube-94a5ff8a4a75d75bb9df542a39ce8769e7a7e6a4.tar.gz
PeerTube-94a5ff8a4a75d75bb9df542a39ce8769e7a7e6a4.tar.zst
PeerTube-94a5ff8a4a75d75bb9df542a39ce8769e7a7e6a4.zip
Move job queue to redis
We'll use it as cache in the future. /!\ You'll loose your old jobs (pending jobs too) so upgrade only when you don't have pending job anymore.
Diffstat (limited to 'server/lib/schedulers/remove-old-jobs-scheduler.ts')
-rw-r--r--server/lib/schedulers/remove-old-jobs-scheduler.ts19
1 files changed, 19 insertions, 0 deletions
diff --git a/server/lib/schedulers/remove-old-jobs-scheduler.ts b/server/lib/schedulers/remove-old-jobs-scheduler.ts
new file mode 100644
index 000000000..add5677ac
--- /dev/null
+++ b/server/lib/schedulers/remove-old-jobs-scheduler.ts
@@ -0,0 +1,19 @@
1import { JobQueue } from '../job-queue'
2import { AbstractScheduler } from './abstract-scheduler'
3
4export class RemoveOldJobsScheduler extends AbstractScheduler {
5
6 private static instance: AbstractScheduler
7
8 private constructor () {
9 super()
10 }
11
12 async execute () {
13 JobQueue.Instance.removeOldJobs()
14 }
15
16 static get Instance () {
17 return this.instance || (this.instance = new this())
18 }
19}