Mendeley import: Don't use single transaction

This commit is contained in:
Dan Stillman 2018-06-13 10:27:26 -04:00
parent 94a0c3ce8c
commit d38d55e2b4

View file

@ -806,7 +806,7 @@ Zotero_Import_Mendeley.prototype._convertNote = function (note) {
Zotero_Import_Mendeley.prototype._saveItems = async function (libraryID, json) { Zotero_Import_Mendeley.prototype._saveItems = async function (libraryID, json) {
var idMap = new Map(); var idMap = new Map();
await Zotero.DB.executeTransaction(async function () {
var lastExistingParentItem; var lastExistingParentItem;
for (let i = 0; i < json.length; i++) { for (let i = 0; i < json.length; i++) {
let itemJSON = json[i]; let itemJSON = json[i];
@ -843,7 +843,7 @@ Zotero_Import_Mendeley.prototype._saveItems = async function (libraryID, json) {
delete toSave.documentID; delete toSave.documentID;
item.fromJSON(toSave); item.fromJSON(toSave);
await item.save({ await item.saveTx({
skipSelect: true, skipSelect: true,
skipDateModifiedUpdate: true skipDateModifiedUpdate: true
}); });
@ -851,7 +851,6 @@ Zotero_Import_Mendeley.prototype._saveItems = async function (libraryID, json) {
idMap.set(itemJSON.documentID, item.id); idMap.set(itemJSON.documentID, item.id);
} }
} }
}.bind(this));
return idMap; return idMap;
}; };