mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Optimize activity actor load in AP processors
This commit is contained in:
parent
d4defe07d2
commit
e587e0ecee
16 changed files with 110 additions and 89 deletions
|
@ -323,6 +323,29 @@ export class ActorModel extends Model<ActorModel> {
|
|||
}
|
||||
|
||||
static loadByUrl (url: string, transaction?: Sequelize.Transaction) {
|
||||
const query = {
|
||||
where: {
|
||||
url
|
||||
},
|
||||
transaction,
|
||||
include: [
|
||||
{
|
||||
attributes: [ 'id' ],
|
||||
model: AccountModel.unscoped(),
|
||||
required: false
|
||||
},
|
||||
{
|
||||
attributes: [ 'id' ],
|
||||
model: VideoChannelModel.unscoped(),
|
||||
required: false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
return ActorModel.unscoped().findOne(query)
|
||||
}
|
||||
|
||||
static loadByUrlAndPopulateAccountAndChannel (url: string, transaction?: Sequelize.Transaction) {
|
||||
const query = {
|
||||
where: {
|
||||
url
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue