mirror of
https://github.com/zadam/trilium.git
synced 2025-11-18 03:00:41 +01:00
entities are now changed only if entity hash changed which will limit number of events emitted
This commit is contained in:
@@ -60,6 +60,7 @@ async function updateEntity(entity) {
|
||||
|
||||
delete clone.jsonContent;
|
||||
delete clone.isOwned;
|
||||
delete clone.isChanged;
|
||||
|
||||
for (const key in clone) {
|
||||
// !isBuffer is for images and attachments
|
||||
@@ -73,7 +74,7 @@ async function updateEntity(entity) {
|
||||
|
||||
const primaryKey = entity[entity.constructor.primaryKeyName];
|
||||
|
||||
if (entity.constructor.tableName !== 'options' || entity.isSynced) {
|
||||
if (entity.isChanged && (entity.constructor.tableName !== 'options' || entity.isSynced)) {
|
||||
await syncTableService.addEntitySync(entity.constructor.tableName, primaryKey);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user