diff options
author | Chocobozzz <me@florianbigard.com> | 2018-09-19 11:41:21 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-09-19 11:41:30 +0200 |
commit | d4defe07d26013a75577b30608841fe3f8334308 (patch) | |
tree | ca45a396884c57046cc7f158ee0d38036e49c7cb /server/models/activitypub | |
parent | 4157cdb13748cb6e8ce7081d062a8778554cc5a7 (diff) | |
download | PeerTube-d4defe07d26013a75577b30608841fe3f8334308.tar.gz PeerTube-d4defe07d26013a75577b30608841fe3f8334308.tar.zst PeerTube-d4defe07d26013a75577b30608841fe3f8334308.zip |
Optimize video view AP processing
Diffstat (limited to 'server/models/activitypub')
-rw-r--r-- | server/models/activitypub/actor.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/server/models/activitypub/actor.ts b/server/models/activitypub/actor.ts index ef8dd9f7c..69c2eca57 100644 --- a/server/models/activitypub/actor.ts +++ b/server/models/activitypub/actor.ts | |||
@@ -266,6 +266,18 @@ export class ActorModel extends Model<ActorModel> { | |||
266 | return ActorModel.unscoped().findById(id) | 266 | return ActorModel.unscoped().findById(id) |
267 | } | 267 | } |
268 | 268 | ||
269 | static isActorUrlExist (url: string) { | ||
270 | const query = { | ||
271 | raw: true, | ||
272 | where: { | ||
273 | url | ||
274 | } | ||
275 | } | ||
276 | |||
277 | return ActorModel.unscoped().findOne(query) | ||
278 | .then(a => !!a) | ||
279 | } | ||
280 | |||
269 | static listByFollowersUrls (followersUrls: string[], transaction?: Sequelize.Transaction) { | 281 | static listByFollowersUrls (followersUrls: string[], transaction?: Sequelize.Transaction) { |
270 | const query = { | 282 | const query = { |
271 | where: { | 283 | where: { |