mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Avoid making retried requests to dead followers
This commit is contained in:
parent
9a8cbd8278
commit
6502c3d43e
7 changed files with 44 additions and 3 deletions
|
@ -163,6 +163,34 @@ export class ActorFollowModel extends Model<ActorFollowModel> {
|
|||
return ActorFollowModel.findOne(query)
|
||||
}
|
||||
|
||||
static loadByFollowerInbox (url: string, t?: Sequelize.Transaction) {
|
||||
const query = {
|
||||
where: {
|
||||
state: 'accepted'
|
||||
},
|
||||
include: [
|
||||
{
|
||||
model: ActorModel,
|
||||
required: true,
|
||||
as: 'ActorFollower',
|
||||
where: {
|
||||
[Sequelize.Op.or]: [
|
||||
{
|
||||
inboxUrl: url
|
||||
},
|
||||
{
|
||||
sharedInboxUrl: url
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
transaction: t
|
||||
} as any // FIXME: typings does not work
|
||||
|
||||
return ActorFollowModel.findOne(query)
|
||||
}
|
||||
|
||||
static listFollowingForApi (id: number, start: number, count: number, sort: string) {
|
||||
const query = {
|
||||
distinct: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue