@xuda.io/xuda-worker-bundle-min 1.3.354 → 1.3.356
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 +25 -13
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -371,11 +371,12 @@ 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
|
-
return success_callback(json, true);
|
|
374
|
+
// return success_callback(json, true);
|
|
375
|
+
return json;
|
|
375
376
|
} catch (err) {
|
|
376
|
-
try {
|
|
377
|
-
|
|
378
|
-
|
|
377
|
+
// try {
|
|
378
|
+
const json = await perform_rpi_request(serviceP);
|
|
379
|
+
if (json.opt) {
|
|
379
380
|
try {
|
|
380
381
|
await db.put({
|
|
381
382
|
_id: rep_id,
|
|
@@ -384,11 +385,12 @@ func.common.db = async function (
|
|
|
384
385
|
ts: Date.now(),
|
|
385
386
|
});
|
|
386
387
|
} catch (err) {}
|
|
387
|
-
|
|
388
|
-
return success_callback(json, true);
|
|
389
|
-
} catch (err) {
|
|
390
|
-
return error_callback(err);
|
|
391
388
|
}
|
|
389
|
+
return json;
|
|
390
|
+
// return success_callback(json, true);
|
|
391
|
+
// } catch (err) {
|
|
392
|
+
// return error_callback(err);
|
|
393
|
+
// }
|
|
392
394
|
}
|
|
393
395
|
};
|
|
394
396
|
|
|
@@ -403,11 +405,21 @@ func.common.db = async function (
|
|
|
403
405
|
serviceP
|
|
404
406
|
)
|
|
405
407
|
) {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
408
|
+
try {
|
|
409
|
+
const ret = {
|
|
410
|
+
code: 1,
|
|
411
|
+
data: await perform_rpi_request_from_pouch(serviceP),
|
|
412
|
+
};
|
|
413
|
+
return success_callback(ret);
|
|
414
|
+
} catch (err) {
|
|
415
|
+
return error_callback(err);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// const ret = {
|
|
419
|
+
// code: 1,
|
|
420
|
+
// data: await perform_rpi_request_from_pouch(serviceP),
|
|
421
|
+
// };
|
|
422
|
+
// return success_callback(ret);
|
|
411
423
|
}
|
|
412
424
|
try {
|
|
413
425
|
const json = await perform_rpi_request(serviceP);
|