@xuda.io/xuda-worker-bundle-min 1.3.364 → 1.3.366
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -371,15 +371,15 @@ func.common.db = async function (
|
|
|
371
371
|
const doc = await db.get(rep_id);
|
|
372
372
|
if (doc.stat < 3) throw "replication not ready";
|
|
373
373
|
const json = await func.db.pouch[serviceP](SESSION_ID, dataP);
|
|
374
|
-
|
|
374
|
+
|
|
375
375
|
return json;
|
|
376
376
|
} catch (err) {
|
|
377
|
-
// try {
|
|
378
377
|
const json = await perform_rpi_request(serviceP);
|
|
379
378
|
if (json.opt) {
|
|
380
379
|
try {
|
|
381
380
|
try {
|
|
382
381
|
await db.get(rep_id);
|
|
382
|
+
} catch (err) {
|
|
383
383
|
await db.put({
|
|
384
384
|
_id: rep_id,
|
|
385
385
|
selector: json.opt.selector,
|
|
@@ -387,15 +387,11 @@ func.common.db = async function (
|
|
|
387
387
|
ts: Date.now(),
|
|
388
388
|
docType: "rep_request",
|
|
389
389
|
});
|
|
390
|
-
}
|
|
390
|
+
}
|
|
391
391
|
func.db.pouch.set_db_replication_from_server(SESSION_ID, rep_id);
|
|
392
392
|
} catch (err) {}
|
|
393
393
|
}
|
|
394
394
|
return json;
|
|
395
|
-
// return success_callback(json, true);
|
|
396
|
-
// } catch (err) {
|
|
397
|
-
// return error_callback(err);
|
|
398
|
-
// }
|
|
399
395
|
}
|
|
400
396
|
};
|
|
401
397
|
|