High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
fix(server): deadlock when fetching vector count (#18728)
Mertbe247395dbc5
diff --git a/server/src/repositories/database.repository.ts b/server/src/repositories/database.repository.tsindex 1e8e147c43..94d9029f60 100644--- a/server/src/repositories/database.repository.ts+++ b/server/src/repositories/database.repository.ts@@ -246,6 +246,7 @@ export class DatabaseRepository {return;}const dimSize = await this.getDimensionSize(table);+ lists ||= this.targetListCount(await this.getRowCount(table));await this.db.schema.dropIndex(indexName).ifExists().execute();if (table === 'smart_search') {await this.db.schema.alterTable(table).dropConstraint('dim_size_constraint').ifExists().execute();@@ -262,7 +263,6 @@ export class DatabaseRepository {ALTER TABLE ${sql.raw(table)}ALTER COLUMN embeddingSET DATA TYPE ${sql.raw(schema)}vector(${sql.raw(String(dimSize))})`.execute(tx);- lists ||= this.targetListCount(await this.getRowCount(table));await sql.raw(vectorIndexQuery({ vectorExtension, table, indexName, lists })).execute(tx);});try {