Skip to content

Build your personal knowledge base with Trilium Notes

not sending ping to clients after every sync addition, only after commit which significantly speeds up imports

zadam3fa3e912a4fe
diff --git a/src/services/sql.js b/src/services/sql.js
index 2997293485..9e00168c5f 100644
--- a/src/services/sql.js
+++ b/src/services/sql.js
@@ -209,6 +209,8 @@ async function transactional(func) {
transactionActive = false;
resolve();
+
+ setTimeout(() => require('./ws').sendPingToAllClients(), 50);
}
catch (e) {
if (transactionActive) {
diff --git a/src/services/sync_table.js b/src/services/sync_table.js
index c96cf2ba08..4ed4abcff2 100644
--- a/src/services/sync_table.js
+++ b/src/services/sync_table.js
@@ -24,8 +24,6 @@ async function addEntitySync(entityName, entityId, sourceId) {
const sync = await insertEntitySync(entityName, entityId, sourceId);
syncs.push(sync);
-
- setTimeout(() => require('./ws').sendPingToAllClients(), 50);
}
async function addEntitySyncsForSector(entityName, entityPrimaryKey, sector) {