aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/schedulers/bad-actor-follow-scheduler.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/schedulers/bad-actor-follow-scheduler.ts')
-rw-r--r--server/lib/schedulers/bad-actor-follow-scheduler.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/server/lib/schedulers/bad-actor-follow-scheduler.ts b/server/lib/schedulers/bad-actor-follow-scheduler.ts
new file mode 100644
index 000000000..c6c285ece
--- /dev/null
+++ b/server/lib/schedulers/bad-actor-follow-scheduler.ts
@@ -0,0 +1,24 @@
1import { logger } from '../../helpers/logger'
2import { ActorFollowModel } from '../../models/activitypub/actor-follow'
3import { AbstractScheduler } from './abstract-scheduler'
4
5export class BadActorFollowScheduler extends AbstractScheduler {
6
7 private static instance: AbstractScheduler
8
9 private constructor () {
10 super()
11 }
12
13 async execute () {
14 try {
15 await ActorFollowModel.removeBadActorFollows()
16 } catch (err) {
17 logger.error('Error in bad actor follows scheduler.', err)
18 }
19 }
20
21 static get Instance () {
22 return this.instance || (this.instance = new this())
23 }
24}