@xuda.io/xuda-worker-bundle-min 1.3.353 → 1.3.354
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 +16 -13
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -370,23 +370,26 @@ func.common.db = async function (
|
|
|
370
370
|
try {
|
|
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
|
+
return success_callback(json, true);
|
|
374
375
|
} catch (err) {
|
|
375
|
-
ret = await perform_rpi_request();
|
|
376
376
|
try {
|
|
377
|
-
await
|
|
378
|
-
_id: rep_id,
|
|
379
|
-
selector: ret.opt.selector,
|
|
380
|
-
stat: 1,
|
|
381
|
-
ts: Date.now(),
|
|
382
|
-
});
|
|
383
|
-
} catch (err) {}
|
|
384
|
-
}
|
|
377
|
+
const json = await perform_rpi_request(serviceP);
|
|
385
378
|
|
|
386
|
-
|
|
379
|
+
try {
|
|
380
|
+
await db.put({
|
|
381
|
+
_id: rep_id,
|
|
382
|
+
selector: json.opt.selector,
|
|
383
|
+
stat: 1,
|
|
384
|
+
ts: Date.now(),
|
|
385
|
+
});
|
|
386
|
+
} catch (err) {}
|
|
387
387
|
|
|
388
|
-
|
|
389
|
-
|
|
388
|
+
return success_callback(json, true);
|
|
389
|
+
} catch (err) {
|
|
390
|
+
return error_callback(err);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
390
393
|
};
|
|
391
394
|
|
|
392
395
|
if (
|