diff options
Diffstat (limited to 'server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-unicast-handler.ts')
-rw-r--r-- | server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-unicast-handler.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-unicast-handler.ts b/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-unicast-handler.ts index 175ec6642..e02bd698e 100644 --- a/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-unicast-handler.ts +++ b/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-unicast-handler.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | import { logger } from '../../../helpers/logger' | 1 | import { logger } from '../../../helpers/logger' |
2 | import { doRequest } from '../../../helpers/requests' | 2 | import { doRequest } from '../../../helpers/requests' |
3 | import { ActorFollowModel } from '../../../models/activitypub/actor-follow' | ||
3 | import { ActivityPubHttpPayload, buildSignedRequestOptions, computeBody, maybeRetryRequestLater } from './activitypub-http-job-scheduler' | 4 | import { ActivityPubHttpPayload, buildSignedRequestOptions, computeBody, maybeRetryRequestLater } from './activitypub-http-job-scheduler' |
4 | 5 | ||
5 | async function process (payload: ActivityPubHttpPayload, jobId: number) { | 6 | async function process (payload: ActivityPubHttpPayload, jobId: number) { |
@@ -18,8 +19,13 @@ async function process (payload: ActivityPubHttpPayload, jobId: number) { | |||
18 | 19 | ||
19 | try { | 20 | try { |
20 | await doRequest(options) | 21 | await doRequest(options) |
22 | await ActorFollowModel.updateActorFollowsScoreAndRemoveBadOnes([ uri ], [], undefined) | ||
21 | } catch (err) { | 23 | } catch (err) { |
22 | await maybeRetryRequestLater(err, payload, uri) | 24 | const isRetryingLater = await maybeRetryRequestLater(err, payload, uri) |
25 | if (isRetryingLater === false) { | ||
26 | await ActorFollowModel.updateActorFollowsScoreAndRemoveBadOnes([], [ uri ], undefined) | ||
27 | } | ||
28 | |||
23 | throw err | 29 | throw err |
24 | } | 30 | } |
25 | } | 31 | } |