From 7bc29171456ffa91c7ec8dc77e892c7dca359989 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 11 Jan 2018 11:40:18 +0100 Subject: Add tests to handle down server --- .../activitypub-http-job-scheduler/activitypub-http-job-scheduler.ts | 1 - .../activitypub-http-unicast-handler.ts | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'server/lib/jobs') diff --git a/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-job-scheduler.ts b/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-job-scheduler.ts index 884ede5a3..10423a7df 100644 --- a/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-job-scheduler.ts +++ b/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-job-scheduler.ts @@ -4,7 +4,6 @@ import { logger } from '../../../helpers/logger' import { getServerActor } from '../../../helpers/utils' import { ACTIVITY_PUB } from '../../../initializers' import { ActorModel } from '../../../models/activitypub/actor' -import { ActorFollowModel } from '../../../models/activitypub/actor-follow' import { JobHandler, JobScheduler } from '../job-scheduler' import * as activitypubHttpBroadcastHandler from './activitypub-http-broadcast-handler' 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 e02bd698e..deedf8402 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 @@ -19,11 +19,11 @@ async function process (payload: ActivityPubHttpPayload, jobId: number) { try { await doRequest(options) - await ActorFollowModel.updateActorFollowsScoreAndRemoveBadOnes([ uri ], [], undefined) + ActorFollowModel.updateActorFollowsScoreAndRemoveBadOnes([ uri ], [], undefined) } catch (err) { const isRetryingLater = await maybeRetryRequestLater(err, payload, uri) if (isRetryingLater === false) { - await ActorFollowModel.updateActorFollowsScoreAndRemoveBadOnes([], [ uri ], undefined) + ActorFollowModel.updateActorFollowsScoreAndRemoveBadOnes([], [ uri ], undefined) } throw err -- cgit v1.2.3