1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

Improve local search relevancy

This commit is contained in:
Chocobozzz 2024-09-12 09:54:37 +02:00
parent f27f392721
commit e18ac0a468
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 25 additions and 16 deletions

View file

@ -10,11 +10,13 @@ export class AbstractRunQuery {
protected query: string
protected replacements: any = {}
protected queryConfig = ''
constructor (protected readonly sequelize: Sequelize) {
}
protected runQuery (options: { nest?: boolean, transaction?: Transaction, logging?: boolean } = {}) {
protected async runQuery (options: { nest?: boolean, transaction?: Transaction, logging?: boolean } = {}) {
const queryOptions = {
transaction: options.transaction,
logging: options.logging,
@ -23,6 +25,10 @@ export class AbstractRunQuery {
nest: options.nest ?? false
}
if (this.queryConfig) {
await this.sequelize.query(this.queryConfig, queryOptions)
}
return this.sequelize.query<any>(this.query, queryOptions)
}