Skip to content
Extraits de code Groupes Projets
Valider 24af8881 rédigé par Christian Paul's avatar Christian Paul
Parcourir les fichiers

Add debugging of countEntries()

parent f7556e51
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -103,15 +103,20 @@ export class DbRoomStore {
* Matrix room and a remote room counts as one pair.
* @returns {number} The amount of room pairs as an integer
*/
public async countEntries() {
public async countEntries(): Promise<number> {
const row = (await this.db.Get("SELECT COUNT(*) AS count FROM room_entries WHERE matrix_id IS NOT NULL AND remote_id IS NOT NULL")) || {};
if (typeof row.count !== "number") {
let count = row.count;
if (typeof count === 'string') {
count = Number.parseInt(count);
}
if (typeof count !== "number") {
log.error("Failed to count room entries");
throw Error("Failed to count room entries");
throw Error(`Failed to count room entries ${JSON.stringify(row)} AND ${typeof count}`);
}
return row.count;
return count;
}
public async upsertEntry(entry: IRoomStoreEntry) {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter