mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Store_applyIncoming, SyncEngine__applyIncoming: async + async/yield -> sync.
This commit is contained in:
parent
fce5aa36de
commit
3a4f2ca0ee
@ -353,7 +353,7 @@ SyncEngine.prototype = {
|
||||
item.decrypt(ID.get('WeaveCryptoID').password);
|
||||
if (this._reconcile(item)) {
|
||||
count.applied++;
|
||||
yield this._applyIncoming.async(this, self.cb, item);
|
||||
this._applyIncoming(item);
|
||||
} else {
|
||||
count.reconciled++;
|
||||
this._log.trace("Skipping reconciled incoming item " + item.id);
|
||||
@ -442,11 +442,10 @@ SyncEngine.prototype = {
|
||||
|
||||
// Apply incoming records
|
||||
_applyIncoming: function SyncEngine__applyIncoming(item) {
|
||||
let self = yield;
|
||||
this._log.trace("Incoming:\n" + item);
|
||||
try {
|
||||
this._tracker.ignoreAll = true;
|
||||
yield this._store.applyIncoming(self.cb, item);
|
||||
this._store.applyIncoming(item);
|
||||
if (this._lastSyncTmp < item.modified)
|
||||
this._lastSyncTmp = item.modified;
|
||||
} catch (e) {
|
||||
|
@ -74,17 +74,13 @@ Store.prototype = {
|
||||
this._log = Log4Moz.repository.getLogger("Store." + this._logName);
|
||||
},
|
||||
|
||||
applyIncoming: function Store_applyIncoming(onComplete, record) {
|
||||
let fn = function(rec) {
|
||||
let self = yield;
|
||||
if (rec.deleted)
|
||||
this.remove(rec);
|
||||
else if (!this.itemExists(rec.id))
|
||||
this.create(rec);
|
||||
else
|
||||
this.update(rec);
|
||||
};
|
||||
fn.async(this, onComplete, record);
|
||||
applyIncoming: function Store_applyIncoming(record) {
|
||||
if (record.deleted)
|
||||
this.remove(record);
|
||||
else if (!this.itemExists(record.id))
|
||||
this.create(record);
|
||||
else
|
||||
this.update(record);
|
||||
},
|
||||
|
||||
// override these in derived objects
|
||||
|
Loading…
Reference in New Issue
Block a user