@xuda.io/xuda-worker-bundle-min 1.3.478 → 1.3.480
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 +10 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -318,13 +318,19 @@ func.common.db = async function (
|
|
|
318
318
|
const { code: table_req_code, data: table_req_id } =
|
|
319
319
|
await validate_existence_of_whole_table_request(db);
|
|
320
320
|
if (table_req_code > 0) {
|
|
321
|
-
return
|
|
321
|
+
return {
|
|
322
|
+
code: 1,
|
|
323
|
+
data: await func.db.pouch[serviceP](SESSION_ID, data),
|
|
324
|
+
};
|
|
322
325
|
}
|
|
323
326
|
|
|
324
327
|
try {
|
|
325
328
|
const doc = await db.get(rep_id);
|
|
326
329
|
if (doc.stat < 3) throw "replication not ready";
|
|
327
|
-
const json =
|
|
330
|
+
const json = {
|
|
331
|
+
code: 1,
|
|
332
|
+
data: await func.db.pouch[serviceP](SESSION_ID, data),
|
|
333
|
+
};
|
|
328
334
|
|
|
329
335
|
return json;
|
|
330
336
|
} catch (err) {
|
|
@@ -334,14 +340,14 @@ func.common.db = async function (
|
|
|
334
340
|
opt,
|
|
335
341
|
data
|
|
336
342
|
);
|
|
337
|
-
if (json.opt) {
|
|
343
|
+
if (json.data.opt) {
|
|
338
344
|
try {
|
|
339
345
|
try {
|
|
340
346
|
await db.get(rep_id);
|
|
341
347
|
} catch (err) {
|
|
342
348
|
await db.put({
|
|
343
349
|
_id: rep_id,
|
|
344
|
-
selector: json.opt.selector,
|
|
350
|
+
selector: json.data.opt.selector,
|
|
345
351
|
stat: 1,
|
|
346
352
|
ts: Date.now(),
|
|
347
353
|
docType: "rep_request",
|