diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-25 15:05:18 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-25 18:41:17 +0100 |
commit | 94a5ff8a4a75d75bb9df542a39ce8769e7a7e6a4 (patch) | |
tree | 32a9148e0e4567f0c4ffae0412cbed20b84e8873 /server/lib/activitypub/fetch.ts | |
parent | d765fafc3faf0db9818eb1a07161df1cb1bc0efa (diff) | |
download | PeerTube-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/activitypub/fetch.ts')
-rw-r--r-- | server/lib/activitypub/fetch.ts | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/server/lib/activitypub/fetch.ts b/server/lib/activitypub/fetch.ts index 4fc97cc38..b1b370a1a 100644 --- a/server/lib/activitypub/fetch.ts +++ b/server/lib/activitypub/fetch.ts | |||
@@ -1,13 +1,12 @@ | |||
1 | import { Transaction } from 'sequelize' | ||
2 | import { ActorModel } from '../../models/activitypub/actor' | 1 | import { ActorModel } from '../../models/activitypub/actor' |
3 | import { activitypubHttpJobScheduler, ActivityPubHttpPayload } from '../jobs/activitypub-http-job-scheduler' | 2 | import { JobQueue } from '../job-queue' |
4 | 3 | ||
5 | async function addFetchOutboxJob (actor: ActorModel, t: Transaction) { | 4 | async function addFetchOutboxJob (actor: ActorModel) { |
6 | const jobPayload: ActivityPubHttpPayload = { | 5 | const payload = { |
7 | uris: [ actor.outboxUrl ] | 6 | uris: [ actor.outboxUrl ] |
8 | } | 7 | } |
9 | 8 | ||
10 | return activitypubHttpJobScheduler.createJob(t, 'activitypubHttpFetcherHandler', jobPayload) | 9 | return JobQueue.Instance.createJob({ type: 'activitypub-http-fetcher', payload }) |
11 | } | 10 | } |
12 | 11 | ||
13 | export { | 12 | export { |