@pisell/core 1.0.30 → 1.1.1
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/es/app/app.d.ts +3 -7
- package/es/app/app.js +0 -3
- package/es/indexDB/index.d.ts +6 -3
- package/es/indexDB/index.js +265 -41
- package/es/request/cache.d.ts +1 -1
- package/es/request/cache.js +29 -81
- package/es/request/index.d.ts +3 -3
- package/es/request/index.js +1 -14
- package/es/request/type.d.ts +0 -11
- package/es/request/type.js +1 -10
- package/es/request/utils.js +1 -1
- package/es/tasks/index.d.ts +0 -45
- package/es/tasks/index.js +101 -444
- package/es/tasks/type.d.ts +0 -38
- package/lib/app/app.d.ts +3 -7
- package/lib/app/app.js +0 -3
- package/lib/indexDB/index.d.ts +6 -3
- package/lib/indexDB/index.js +218 -21
- package/lib/request/cache.d.ts +1 -1
- package/lib/request/cache.js +5 -42
- package/lib/request/index.d.ts +3 -3
- package/lib/request/index.js +1 -10
- package/lib/request/type.d.ts +0 -11
- package/lib/request/type.js +0 -19
- package/lib/request/utils.js +1 -1
- package/lib/tasks/index.d.ts +0 -45
- package/lib/tasks/index.js +77 -326
- package/lib/tasks/type.d.ts +0 -38
- package/package.json +1 -1
- package/es/tasks/scheduledTasksExample.d.ts +0 -61
- package/es/tasks/scheduledTasksExample.js +0 -351
- package/lib/tasks/scheduledTasksExample.d.ts +0 -61
- package/lib/tasks/scheduledTasksExample.js +0 -267
package/es/tasks/index.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
var _excluded = ["queueId", "module"];
|
|
2
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
2
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
6
3
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
4
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -29,10 +26,7 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
29
26
|
var _this = this;
|
|
30
27
|
_classCallCheck(this, TasksManager);
|
|
31
28
|
_defineProperty(this, "taskFunctions", void 0);
|
|
32
|
-
_defineProperty(this, "tasks",
|
|
33
|
-
// 内置模块, 定时任务专用
|
|
34
|
-
scheduledTasks: {}
|
|
35
|
-
});
|
|
29
|
+
_defineProperty(this, "tasks", void 0);
|
|
36
30
|
_defineProperty(this, "app", void 0);
|
|
37
31
|
_defineProperty(this, "db", void 0);
|
|
38
32
|
_defineProperty(this, "useTasks", useTasks);
|
|
@@ -240,195 +234,6 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
240
234
|
}
|
|
241
235
|
_this.timerIds = _toConsumableArray(_timerIds || []);
|
|
242
236
|
});
|
|
243
|
-
/**
|
|
244
|
-
* @title: 计算下一次执行时间
|
|
245
|
-
* @description: 根据定时任务配置计算下一次执行时间
|
|
246
|
-
* @param {Task} task
|
|
247
|
-
* @return {string | null} 下一次执行时间
|
|
248
|
-
*/
|
|
249
|
-
_defineProperty(this, "calculateNextExecuteTime", function (task) {
|
|
250
|
-
if (!task.scheduled) {
|
|
251
|
-
return null;
|
|
252
|
-
}
|
|
253
|
-
var scheduled = task.scheduled,
|
|
254
|
-
scheduledResult = task.scheduledResult;
|
|
255
|
-
var now = dayjs();
|
|
256
|
-
|
|
257
|
-
// 如果有结束时间,检查是否已超过
|
|
258
|
-
if (scheduled.endAt && now.isAfter(dayjs(scheduled.endAt))) {
|
|
259
|
-
return null;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
// 如果 executeAt 是数组,找到第一个未来的时间点
|
|
263
|
-
if (Array.isArray(scheduled.executeAt)) {
|
|
264
|
-
var futureTime = scheduled.executeAt.map(function (time) {
|
|
265
|
-
return dayjs(time);
|
|
266
|
-
}).filter(function (time) {
|
|
267
|
-
return time.isAfter(now);
|
|
268
|
-
}).sort(function (a, b) {
|
|
269
|
-
return a.valueOf() - b.valueOf();
|
|
270
|
-
})[0];
|
|
271
|
-
if (futureTime) {
|
|
272
|
-
return futureTime.format("YYYY-MM-DD HH:mm:ss");
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
// 如果所有时间点都已过,且设置了重复
|
|
276
|
-
if (!scheduled.repeat) {
|
|
277
|
-
return null;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
// 如果是重复任务,计算下一次执行时间
|
|
282
|
-
if (scheduled.repeat && scheduledResult !== null && scheduledResult !== void 0 && scheduledResult.nextExecuteTime) {
|
|
283
|
-
var lastExecuteTime = dayjs(scheduledResult.nextExecuteTime);
|
|
284
|
-
var interval = scheduled.repeatInterval || 1;
|
|
285
|
-
var nextTime = lastExecuteTime;
|
|
286
|
-
switch (scheduled.repeatType) {
|
|
287
|
-
case 'daily':
|
|
288
|
-
nextTime = lastExecuteTime.add(interval, 'day');
|
|
289
|
-
break;
|
|
290
|
-
case 'weekly':
|
|
291
|
-
nextTime = lastExecuteTime.add(interval, 'week');
|
|
292
|
-
break;
|
|
293
|
-
case 'monthly':
|
|
294
|
-
nextTime = lastExecuteTime.add(interval, 'month');
|
|
295
|
-
break;
|
|
296
|
-
case 'yearly':
|
|
297
|
-
nextTime = lastExecuteTime.add(interval, 'year');
|
|
298
|
-
break;
|
|
299
|
-
default:
|
|
300
|
-
nextTime = lastExecuteTime.add(interval, 'day');
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
// 检查是否超过结束时间
|
|
304
|
-
if (scheduled.endAt && nextTime.isAfter(dayjs(scheduled.endAt))) {
|
|
305
|
-
return null;
|
|
306
|
-
}
|
|
307
|
-
return nextTime.format("YYYY-MM-DD HH:mm:ss");
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
// 首次执行,返回 executeAt 指定的时间
|
|
311
|
-
var executeTime = Array.isArray(scheduled.executeAt) ? scheduled.executeAt[0] : scheduled.executeAt;
|
|
312
|
-
return dayjs(executeTime).format("YYYY-MM-DD HH:mm:ss");
|
|
313
|
-
});
|
|
314
|
-
/**
|
|
315
|
-
* @title: 启动定时任务
|
|
316
|
-
* @description: 在特定时间点执行任务(仅在 scheduledTasks 模块中生效)
|
|
317
|
-
* @param {Task} task
|
|
318
|
-
* @return {*}
|
|
319
|
-
*/
|
|
320
|
-
_defineProperty(this, "startScheduledTask", function (task) {
|
|
321
|
-
if (!task.scheduled) {
|
|
322
|
-
console.log("Tasks--->", "不是定时任务");
|
|
323
|
-
return;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
// 安全检查:确保任务属于 scheduledTasks 模块
|
|
327
|
-
if (task.module !== 'scheduledTasks') {
|
|
328
|
-
console.warn("Tasks--->", "\u5B9A\u65F6\u4EFB\u52A1\u53EA\u5728 scheduledTasks \u6A21\u5757\u4E2D\u751F\u6548\uFF0C\u4EFB\u52A1 ".concat(task.id, " \u5C06\u4F5C\u4E3A\u666E\u901A\u4EFB\u52A1\u6267\u884C"));
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
var nextExecuteTime = _this.calculateNextExecuteTime(task);
|
|
332
|
-
if (!nextExecuteTime) {
|
|
333
|
-
console.log("Tasks--->", "定时任务已完成或无下次执行时间", task);
|
|
334
|
-
// 删除已完成的定时任务
|
|
335
|
-
_this.deleteTask({
|
|
336
|
-
module: task.module,
|
|
337
|
-
queueId: task.queueId,
|
|
338
|
-
taskId: task.id
|
|
339
|
-
});
|
|
340
|
-
return;
|
|
341
|
-
}
|
|
342
|
-
var now = dayjs();
|
|
343
|
-
var executeTime = dayjs(nextExecuteTime);
|
|
344
|
-
var delay = executeTime.diff(now);
|
|
345
|
-
if (delay < 0) {
|
|
346
|
-
console.log("Tasks--->", "执行时间已过,跳过此次执行");
|
|
347
|
-
// 如果是重复任务,计算下一次执行时间
|
|
348
|
-
if (task.scheduled.repeat) {
|
|
349
|
-
var _task$scheduledResult;
|
|
350
|
-
var _task = _objectSpread({}, task);
|
|
351
|
-
_task.scheduledResult = {
|
|
352
|
-
count: ((_task$scheduledResult = _task.scheduledResult) === null || _task$scheduledResult === void 0 ? void 0 : _task$scheduledResult.count) || 0,
|
|
353
|
-
nextExecuteTime: nextExecuteTime
|
|
354
|
-
};
|
|
355
|
-
var newTask = _this.updateTask({
|
|
356
|
-
module: task.module,
|
|
357
|
-
queueId: task.queueId,
|
|
358
|
-
taskId: task.id,
|
|
359
|
-
other: _task
|
|
360
|
-
});
|
|
361
|
-
if (newTask) {
|
|
362
|
-
_this.startScheduledTask(newTask);
|
|
363
|
-
}
|
|
364
|
-
} else {
|
|
365
|
-
_this.deleteTask({
|
|
366
|
-
module: task.module,
|
|
367
|
-
queueId: task.queueId,
|
|
368
|
-
taskId: task.id
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
return;
|
|
372
|
-
}
|
|
373
|
-
console.log("Tasks--->", "\u5B9A\u65F6\u4EFB\u52A1\u5C06\u5728 ".concat(nextExecuteTime, " \u6267\u884C (").concat(delay, "ms \u540E)"), task);
|
|
374
|
-
|
|
375
|
-
// 创建定时器
|
|
376
|
-
var timerId = setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
377
|
-
var _task2$scheduledResul, _task$scheduled, _task2, _newTask;
|
|
378
|
-
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
379
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
380
|
-
case 0:
|
|
381
|
-
_context4.prev = 0;
|
|
382
|
-
_context4.next = 3;
|
|
383
|
-
return _this.runTask(task);
|
|
384
|
-
case 3:
|
|
385
|
-
console.log("Tasks--->", "定时任务执行完成", task);
|
|
386
|
-
_task2 = _objectSpread({}, task);
|
|
387
|
-
_task2.scheduledResult = {
|
|
388
|
-
count: (((_task2$scheduledResul = _task2.scheduledResult) === null || _task2$scheduledResul === void 0 ? void 0 : _task2$scheduledResul.count) || 0) + 1,
|
|
389
|
-
timerId: timerId,
|
|
390
|
-
nextExecuteTime: nextExecuteTime
|
|
391
|
-
};
|
|
392
|
-
|
|
393
|
-
// 如果是重复任务,继续调度下一次执行
|
|
394
|
-
if ((_task$scheduled = task.scheduled) !== null && _task$scheduled !== void 0 && _task$scheduled.repeat) {
|
|
395
|
-
_newTask = _this.updateTask({
|
|
396
|
-
module: task.module,
|
|
397
|
-
queueId: task.queueId,
|
|
398
|
-
taskId: task.id,
|
|
399
|
-
other: _task2
|
|
400
|
-
});
|
|
401
|
-
if (_newTask) {
|
|
402
|
-
_this.startScheduledTask(_newTask);
|
|
403
|
-
}
|
|
404
|
-
} else {
|
|
405
|
-
// 一次性任务执行完成后删除
|
|
406
|
-
_this.deleteTask({
|
|
407
|
-
module: task.module,
|
|
408
|
-
queueId: task.queueId,
|
|
409
|
-
taskId: task.id
|
|
410
|
-
});
|
|
411
|
-
}
|
|
412
|
-
_context4.next = 13;
|
|
413
|
-
break;
|
|
414
|
-
case 9:
|
|
415
|
-
_context4.prev = 9;
|
|
416
|
-
_context4.t0 = _context4["catch"](0);
|
|
417
|
-
_this.clearTaskTimer({
|
|
418
|
-
timerId: timerId
|
|
419
|
-
});
|
|
420
|
-
console.error("定时任务执行异常", _context4.t0);
|
|
421
|
-
case 13:
|
|
422
|
-
case "end":
|
|
423
|
-
return _context4.stop();
|
|
424
|
-
}
|
|
425
|
-
}, _callee4, null, [[0, 9]]);
|
|
426
|
-
})), delay);
|
|
427
|
-
_this.timerIds.push({
|
|
428
|
-
taskId: task.id,
|
|
429
|
-
timerId: timerId
|
|
430
|
-
});
|
|
431
|
-
});
|
|
432
237
|
/**
|
|
433
238
|
* @title: 启动轮询
|
|
434
239
|
* @description: 根据轮询间隔定期执行任务
|
|
@@ -442,13 +247,13 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
442
247
|
}
|
|
443
248
|
|
|
444
249
|
// 创建轮询定时器
|
|
445
|
-
var timerId = setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
250
|
+
var timerId = setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
446
251
|
var _task$pollingResult, _task, newTask;
|
|
447
|
-
return _regeneratorRuntime().wrap(function
|
|
448
|
-
while (1) switch (
|
|
252
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
253
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
449
254
|
case 0:
|
|
450
|
-
|
|
451
|
-
|
|
255
|
+
_context4.prev = 0;
|
|
256
|
+
_context4.next = 3;
|
|
452
257
|
return _this.runTask(task);
|
|
453
258
|
case 3:
|
|
454
259
|
console.log("轮询任务", task);
|
|
@@ -464,26 +269,26 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
464
269
|
other: _task
|
|
465
270
|
});
|
|
466
271
|
if (newTask) {
|
|
467
|
-
|
|
272
|
+
_context4.next = 9;
|
|
468
273
|
break;
|
|
469
274
|
}
|
|
470
|
-
return
|
|
275
|
+
return _context4.abrupt("return");
|
|
471
276
|
case 9:
|
|
472
277
|
_this.startPolling(newTask);
|
|
473
|
-
|
|
278
|
+
_context4.next = 16;
|
|
474
279
|
break;
|
|
475
280
|
case 12:
|
|
476
|
-
|
|
477
|
-
|
|
281
|
+
_context4.prev = 12;
|
|
282
|
+
_context4.t0 = _context4["catch"](0);
|
|
478
283
|
_this.clearTaskTimer({
|
|
479
284
|
timerId: timerId
|
|
480
285
|
});
|
|
481
|
-
console.error("轮询任务异常",
|
|
286
|
+
console.error("轮询任务异常", _context4.t0);
|
|
482
287
|
case 16:
|
|
483
288
|
case "end":
|
|
484
|
-
return
|
|
289
|
+
return _context4.stop();
|
|
485
290
|
}
|
|
486
|
-
},
|
|
291
|
+
}, _callee4, null, [[0, 12]]);
|
|
487
292
|
})), task.polling.interval);
|
|
488
293
|
_this.timerIds.push({
|
|
489
294
|
taskId: task.id,
|
|
@@ -539,9 +344,7 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
539
344
|
}
|
|
540
345
|
this.app = app;
|
|
541
346
|
this.taskFunctions = new Map();
|
|
542
|
-
this.tasks = {
|
|
543
|
-
scheduledTasks: {}
|
|
544
|
-
};
|
|
347
|
+
this.tasks = {};
|
|
545
348
|
this.db = app.dbManager;
|
|
546
349
|
this.timerIds = [];
|
|
547
350
|
}
|
|
@@ -560,9 +363,9 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
560
363
|
key: "addTaskFunctions",
|
|
561
364
|
value: function addTaskFunctions(tasks) {
|
|
562
365
|
var _this2 = this;
|
|
563
|
-
tasks.forEach(function (
|
|
564
|
-
var name =
|
|
565
|
-
fun =
|
|
366
|
+
tasks.forEach(function (_ref5) {
|
|
367
|
+
var name = _ref5.name,
|
|
368
|
+
fun = _ref5.fun;
|
|
566
369
|
_this2.taskFunctions.set(name, fun);
|
|
567
370
|
});
|
|
568
371
|
}
|
|
@@ -586,15 +389,15 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
586
389
|
}, {
|
|
587
390
|
key: "init",
|
|
588
391
|
value: function () {
|
|
589
|
-
var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
392
|
+
var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
590
393
|
var tasks;
|
|
591
|
-
return _regeneratorRuntime().wrap(function
|
|
592
|
-
while (1) switch (
|
|
394
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
395
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
593
396
|
case 0:
|
|
594
|
-
|
|
397
|
+
_context5.next = 2;
|
|
595
398
|
return this.loadTaskQueueFromLocal();
|
|
596
399
|
case 2:
|
|
597
|
-
tasks =
|
|
400
|
+
tasks = _context5.sent;
|
|
598
401
|
if (tasks) {
|
|
599
402
|
console.log("initTasks", tasks);
|
|
600
403
|
// this.tasks = tasks;
|
|
@@ -603,9 +406,9 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
603
406
|
}
|
|
604
407
|
case 4:
|
|
605
408
|
case "end":
|
|
606
|
-
return
|
|
409
|
+
return _context5.stop();
|
|
607
410
|
}
|
|
608
|
-
},
|
|
411
|
+
}, _callee5, this);
|
|
609
412
|
}));
|
|
610
413
|
function init() {
|
|
611
414
|
return _init.apply(this, arguments);
|
|
@@ -623,42 +426,22 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
623
426
|
* @Date: 2024-09-26 13:52
|
|
624
427
|
*/
|
|
625
428
|
function () {
|
|
626
|
-
var _run = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
627
|
-
var _this$
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
while (1) switch (_context7.prev = _context7.next) {
|
|
429
|
+
var _run = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(payload) {
|
|
430
|
+
var queueId, module, callback, taskQueueStatus, taskQueue, errorTaskIds, _this$getTaskQueue, tasksToExecute, _iterator3, _step3, task, _yield$this$runTask, status, _task$pollingResult2, _other;
|
|
431
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
432
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
631
433
|
case 0:
|
|
632
|
-
queueId = payload.queueId, module = payload.module, callback = payload.callback;
|
|
633
|
-
currentQueue = (_this$tasks$module2 = this.tasks[module]) === null || _this$tasks$module2 === void 0 ? void 0 : _this$tasks$module2[queueId];
|
|
634
|
-
if (!(currentQueue !== null && currentQueue !== void 0 && currentQueue.isRunning)) {
|
|
635
|
-
_context7.next = 5;
|
|
636
|
-
break;
|
|
637
|
-
}
|
|
638
|
-
console.warn("Tasks--->", "\u4EFB\u52A1\u961F\u5217 [".concat(module, "/").concat(queueId, "] \u6B63\u5728\u6267\u884C\u4E2D\uFF0C\u5DF2\u62E6\u622A\u91CD\u590D\u8C03\u7528\u3002"), "\u5F53\u524D\u8FDB\u5EA6: ".concat(((_currentQueue$progres = currentQueue.progress) === null || _currentQueue$progres === void 0 ? void 0 : _currentQueue$progres.completed) || 0, "/").concat(((_currentQueue$progres2 = currentQueue.progress) === null || _currentQueue$progres2 === void 0 ? void 0 : _currentQueue$progres2.total) || 0), "\u5982\u9700\u91CD\u65B0\u6267\u884C\uFF0C\u8BF7\u7B49\u5F85\u5F53\u524D\u4EFB\u52A1\u961F\u5217\u6267\u884C\u5B8C\u6210\u3002");
|
|
639
|
-
return _context7.abrupt("return");
|
|
640
|
-
case 5:
|
|
641
|
-
// 标记队列为执行中
|
|
642
|
-
this.updateQueueRunningState({
|
|
643
|
-
module: module,
|
|
644
|
-
queueId: queueId,
|
|
645
|
-
isRunning: true,
|
|
646
|
-
lastRunAt: dayjs().format("YYYY-MM-DD HH:mm:ss")
|
|
647
|
-
});
|
|
648
|
-
console.log("Tasks--->", "\u4EFB\u52A1\u961F\u5217 [".concat(module, "/").concat(queueId, "] \u5F00\u59CB\u6267\u884C"));
|
|
649
|
-
|
|
650
|
-
//@ts-ignore 当前任务队列
|
|
434
|
+
queueId = payload.queueId, module = payload.module, callback = payload.callback; //@ts-ignore 当前任务队列
|
|
651
435
|
taskQueueStatus = "";
|
|
652
|
-
|
|
653
|
-
case 9:
|
|
436
|
+
case 2:
|
|
654
437
|
if (!(taskQueueStatus !== "completed")) {
|
|
655
|
-
|
|
438
|
+
_context6.next = 61;
|
|
656
439
|
break;
|
|
657
440
|
}
|
|
658
441
|
taskQueue = this.getTaskQueue(payload);
|
|
659
442
|
errorTaskIds = [];
|
|
660
443
|
if (!(taskQueue && taskQueue.length)) {
|
|
661
|
-
|
|
444
|
+
_context6.next = 51;
|
|
662
445
|
break;
|
|
663
446
|
}
|
|
664
447
|
// 只执行未执行(pending)或失败(failure)的任务
|
|
@@ -667,17 +450,17 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
667
450
|
});
|
|
668
451
|
console.log("Tasks--->", "需要执行的任务", tasksToExecute);
|
|
669
452
|
_iterator3 = _createForOfIteratorHelper(tasksToExecute);
|
|
670
|
-
|
|
453
|
+
_context6.prev = 9;
|
|
671
454
|
_iterator3.s();
|
|
672
|
-
case
|
|
455
|
+
case 11:
|
|
673
456
|
if ((_step3 = _iterator3.n()).done) {
|
|
674
|
-
|
|
457
|
+
_context6.next = 38;
|
|
675
458
|
break;
|
|
676
459
|
}
|
|
677
460
|
task = _step3.value;
|
|
678
|
-
|
|
461
|
+
_context6.prev = 13;
|
|
679
462
|
if (!(task.retries !== undefined && task.maxRetries !== undefined && task.retries < task.maxRetries)) {
|
|
680
|
-
|
|
463
|
+
_context6.next = 29;
|
|
681
464
|
break;
|
|
682
465
|
}
|
|
683
466
|
// 标记任务为执行中
|
|
@@ -691,31 +474,23 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
691
474
|
}
|
|
692
475
|
});
|
|
693
476
|
|
|
694
|
-
//
|
|
695
|
-
if (!(task.scheduled && module === 'scheduledTasks')) {
|
|
696
|
-
_context7.next = 28;
|
|
697
|
-
break;
|
|
698
|
-
}
|
|
699
|
-
this.startScheduledTask(task);
|
|
700
|
-
_context7.next = 37;
|
|
701
|
-
break;
|
|
702
|
-
case 28:
|
|
477
|
+
// 轮询任务
|
|
703
478
|
if (!task.polling) {
|
|
704
|
-
|
|
479
|
+
_context6.next = 21;
|
|
705
480
|
break;
|
|
706
481
|
}
|
|
707
482
|
this.startPolling(task);
|
|
708
|
-
|
|
483
|
+
_context6.next = 26;
|
|
709
484
|
break;
|
|
710
|
-
case
|
|
711
|
-
|
|
485
|
+
case 21:
|
|
486
|
+
_context6.next = 23;
|
|
712
487
|
return this.runTask(task);
|
|
713
|
-
case
|
|
714
|
-
_yield$this$runTask =
|
|
488
|
+
case 23:
|
|
489
|
+
_yield$this$runTask = _context6.sent;
|
|
715
490
|
status = _yield$this$runTask.status;
|
|
716
491
|
// 标记任务状态
|
|
717
492
|
task.status = status;
|
|
718
|
-
case
|
|
493
|
+
case 26:
|
|
719
494
|
// 成功: 删除任务
|
|
720
495
|
if (task.status === "success") {
|
|
721
496
|
if ((_task$pollingResult2 = task.pollingResult) !== null && _task$pollingResult2 !== void 0 && _task$pollingResult2.timerId) {}
|
|
@@ -739,9 +514,9 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
739
514
|
other: _other
|
|
740
515
|
});
|
|
741
516
|
}
|
|
742
|
-
|
|
517
|
+
_context6.next = 31;
|
|
743
518
|
break;
|
|
744
|
-
case
|
|
519
|
+
case 29:
|
|
745
520
|
console.log("Tasks--->", "任务没有重试次数,需要删除", task);
|
|
746
521
|
// 如果任务没有重试次数,则删除任务
|
|
747
522
|
this.deleteTask({
|
|
@@ -749,28 +524,28 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
749
524
|
queueId: queueId,
|
|
750
525
|
taskId: task.id
|
|
751
526
|
});
|
|
752
|
-
case
|
|
753
|
-
|
|
527
|
+
case 31:
|
|
528
|
+
_context6.next = 36;
|
|
754
529
|
break;
|
|
755
|
-
case
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
console.error("任务异常",
|
|
759
|
-
case
|
|
760
|
-
|
|
530
|
+
case 33:
|
|
531
|
+
_context6.prev = 33;
|
|
532
|
+
_context6.t0 = _context6["catch"](13);
|
|
533
|
+
console.error("任务异常", _context6.t0);
|
|
534
|
+
case 36:
|
|
535
|
+
_context6.next = 11;
|
|
761
536
|
break;
|
|
762
|
-
case
|
|
763
|
-
|
|
537
|
+
case 38:
|
|
538
|
+
_context6.next = 43;
|
|
764
539
|
break;
|
|
765
|
-
case
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
_iterator3.e(
|
|
769
|
-
case
|
|
770
|
-
|
|
540
|
+
case 40:
|
|
541
|
+
_context6.prev = 40;
|
|
542
|
+
_context6.t1 = _context6["catch"](9);
|
|
543
|
+
_iterator3.e(_context6.t1);
|
|
544
|
+
case 43:
|
|
545
|
+
_context6.prev = 43;
|
|
771
546
|
_iterator3.f();
|
|
772
|
-
return
|
|
773
|
-
case
|
|
547
|
+
return _context6.finish(43);
|
|
548
|
+
case 46:
|
|
774
549
|
taskQueueStatus = (_this$getTaskQueue = this.getTaskQueue(payload)) !== null && _this$getTaskQueue !== void 0 && _this$getTaskQueue.some(function (task) {
|
|
775
550
|
return task.status === "failure";
|
|
776
551
|
}) ? "uncompleted" : "completed";
|
|
@@ -780,13 +555,13 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
780
555
|
status: taskQueueStatus
|
|
781
556
|
});
|
|
782
557
|
console.log("Tasks--->", "任务队列执行完成", taskQueue);
|
|
783
|
-
|
|
558
|
+
_context6.next = 52;
|
|
784
559
|
break;
|
|
785
|
-
case
|
|
560
|
+
case 51:
|
|
786
561
|
taskQueueStatus = "completed";
|
|
787
|
-
case
|
|
562
|
+
case 52:
|
|
788
563
|
if (!(taskQueueStatus === "uncompleted")) {
|
|
789
|
-
|
|
564
|
+
_context6.next = 58;
|
|
790
565
|
break;
|
|
791
566
|
}
|
|
792
567
|
this.app.logger.addLog({
|
|
@@ -797,34 +572,24 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
797
572
|
errorTaskIds: errorTaskIds
|
|
798
573
|
}
|
|
799
574
|
});
|
|
800
|
-
|
|
575
|
+
_context6.next = 56;
|
|
801
576
|
return this.timeout();
|
|
802
|
-
case
|
|
803
|
-
|
|
577
|
+
case 56:
|
|
578
|
+
_context6.next = 59;
|
|
804
579
|
break;
|
|
805
|
-
case
|
|
580
|
+
case 58:
|
|
806
581
|
if (taskQueueStatus === "completed") {
|
|
807
582
|
console.log("Tasks--->", "任务队列全部执行完成");
|
|
808
583
|
callback === null || callback === void 0 || callback();
|
|
809
584
|
}
|
|
810
|
-
case
|
|
811
|
-
|
|
585
|
+
case 59:
|
|
586
|
+
_context6.next = 2;
|
|
812
587
|
break;
|
|
813
|
-
case
|
|
814
|
-
_context7.prev = 72;
|
|
815
|
-
// 无论成功还是失败,都要解除队列的执行状态
|
|
816
|
-
this.updateQueueRunningState({
|
|
817
|
-
module: module,
|
|
818
|
-
queueId: queueId,
|
|
819
|
-
isRunning: false
|
|
820
|
-
});
|
|
821
|
-
console.log("Tasks--->", "\u4EFB\u52A1\u961F\u5217 [".concat(module, "/").concat(queueId, "] \u6267\u884C\u7ED3\u675F"));
|
|
822
|
-
return _context7.finish(72);
|
|
823
|
-
case 76:
|
|
588
|
+
case 61:
|
|
824
589
|
case "end":
|
|
825
|
-
return
|
|
590
|
+
return _context6.stop();
|
|
826
591
|
}
|
|
827
|
-
},
|
|
592
|
+
}, _callee6, this, [[9, 40, 43, 46], [13, 33]]);
|
|
828
593
|
}));
|
|
829
594
|
function run(_x3) {
|
|
830
595
|
return _run.apply(this, arguments);
|
|
@@ -840,23 +605,13 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
840
605
|
module = payload.module,
|
|
841
606
|
taskId = payload.taskId;
|
|
842
607
|
this.tasks[module][queueId].tasks = (_this$tasks = this.tasks) === null || _this$tasks === void 0 || (_this$tasks = _this$tasks[module]) === null || _this$tasks === void 0 || (_this$tasks = _this$tasks[queueId]) === null || _this$tasks === void 0 || (_this$tasks = _this$tasks.tasks) === null || _this$tasks === void 0 ? void 0 : _this$tasks.filter(function (task) {
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
timerId: task.pollingResult.timerId
|
|
849
|
-
});
|
|
850
|
-
}
|
|
851
|
-
// 清除定时任务定时器
|
|
852
|
-
if ((_task$scheduledResult2 = task.scheduledResult) !== null && _task$scheduledResult2 !== void 0 && _task$scheduledResult2.timerId) {
|
|
853
|
-
_this3.clearTaskTimer({
|
|
854
|
-
timerId: task.scheduledResult.timerId
|
|
855
|
-
});
|
|
856
|
-
}
|
|
857
|
-
return false;
|
|
608
|
+
var _task$pollingResult3;
|
|
609
|
+
if ((_task$pollingResult3 = task.pollingResult) !== null && _task$pollingResult3 !== void 0 && _task$pollingResult3.timerId) {
|
|
610
|
+
_this3.clearTaskTimer({
|
|
611
|
+
timerId: task.pollingResult.timerId
|
|
612
|
+
});
|
|
858
613
|
}
|
|
859
|
-
return
|
|
614
|
+
return task.id !== taskId;
|
|
860
615
|
});
|
|
861
616
|
this.saveTaskQueueToLocal(this.tasks);
|
|
862
617
|
console.log("Tasks--->", "删除指定任务", queueId, module, taskId);
|
|
@@ -884,23 +639,19 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
884
639
|
}, {
|
|
885
640
|
key: "addTask",
|
|
886
641
|
value: function addTask(payload) {
|
|
887
|
-
var _this$tasks$
|
|
642
|
+
var _this$tasks$module2,
|
|
888
643
|
_tasks$map,
|
|
889
644
|
_this4 = this;
|
|
890
645
|
var queueId = payload.queueId,
|
|
891
646
|
module = payload.module,
|
|
892
647
|
tasks = payload.tasks;
|
|
893
648
|
|
|
894
|
-
|
|
895
|
-
var taskQueue = (_this$tasks$
|
|
649
|
+
//@ts-ignore 当前任务队列
|
|
650
|
+
var taskQueue = (_this$tasks$module2 = this.tasks[module]) === null || _this$tasks$module2 === void 0 || (_this$tasks$module2 = _this$tasks$module2[queueId]) === null || _this$tasks$module2 === void 0 ? void 0 : _this$tasks$module2.tasks;
|
|
896
651
|
var _tasks = _toConsumableArray(taskQueue || []);
|
|
897
652
|
|
|
898
653
|
// 创建新任务
|
|
899
654
|
var newTasks = tasks === null || tasks === void 0 || (_tasks$map = tasks.map) === null || _tasks$map === void 0 ? void 0 : _tasks$map.call(tasks, function (d) {
|
|
900
|
-
// 检查定时任务配置
|
|
901
|
-
if (d.scheduled && module !== 'scheduledTasks') {
|
|
902
|
-
console.warn("Tasks--->", "\u68C0\u6D4B\u5230\u5B9A\u65F6\u4EFB\u52A1\u914D\u7F6E\uFF0C\u4F46\u6A21\u5757\u4E3A \"".concat(module, "\"\u3002\u5B9A\u65F6\u4EFB\u52A1\u529F\u80FD\u4EC5\u5728 \"scheduledTasks\" \u6A21\u5757\u4E2D\u751F\u6548\u3002"), "\u8BE5\u4EFB\u52A1\u5C06\u4F5C\u4E3A\u666E\u901A\u4EFB\u52A1\u7ACB\u5373\u6267\u884C\u3002\u5982\u9700\u4F7F\u7528\u5B9A\u65F6\u529F\u80FD\uFF0C\u8BF7\u5C06\u4EFB\u52A1\u6DFB\u52A0\u5230 \"scheduledTasks\" \u6A21\u5757\u3002");
|
|
903
|
-
}
|
|
904
655
|
return _this4.createTaskData(_objectSpread(_objectSpread({}, d), {}, {
|
|
905
656
|
queueId: queueId,
|
|
906
657
|
module: module
|
|
@@ -921,13 +672,13 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
921
672
|
}, {
|
|
922
673
|
key: "updateTask",
|
|
923
674
|
value: function updateTask(payload) {
|
|
924
|
-
var _this$tasks$
|
|
675
|
+
var _this$tasks$module3, _this$tasks$module4;
|
|
925
676
|
var queueId = payload.queueId,
|
|
926
677
|
taskId = payload.taskId,
|
|
927
678
|
other = payload.other,
|
|
928
679
|
module = payload.module;
|
|
929
680
|
var newTask = null;
|
|
930
|
-
var taskQueue = ((_this$tasks$
|
|
681
|
+
var taskQueue = ((_this$tasks$module3 = this.tasks[module]) === null || _this$tasks$module3 === void 0 || (_this$tasks$module3 = _this$tasks$module3[queueId]) === null || _this$tasks$module3 === void 0 ? void 0 : _this$tasks$module3.tasks) || [];
|
|
931
682
|
var updatedTasks = taskQueue.map(function (task) {
|
|
932
683
|
if (task.id === taskId) {
|
|
933
684
|
newTask = _objectSpread(_objectSpread({}, task), other); // 更新任务状态
|
|
@@ -935,7 +686,7 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
935
686
|
}
|
|
936
687
|
return task;
|
|
937
688
|
});
|
|
938
|
-
var newState = _objectSpread(_objectSpread({}, this.tasks), {}, _defineProperty({}, module, _objectSpread(_objectSpread({}, this.tasks[module]), {}, _defineProperty({}, queueId, _objectSpread(_objectSpread({}, (_this$tasks$
|
|
689
|
+
var newState = _objectSpread(_objectSpread({}, this.tasks), {}, _defineProperty({}, module, _objectSpread(_objectSpread({}, this.tasks[module]), {}, _defineProperty({}, queueId, _objectSpread(_objectSpread({}, (_this$tasks$module4 = this.tasks[module]) === null || _this$tasks$module4 === void 0 ? void 0 : _this$tasks$module4[queueId]), {}, {
|
|
939
690
|
status: updatedTasks.some(function (task) {
|
|
940
691
|
return task.status === "failure";
|
|
941
692
|
}) ? "uncompleted" : "completed",
|
|
@@ -953,43 +704,9 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
953
704
|
var queueId = payload.queueId,
|
|
954
705
|
status = payload.status,
|
|
955
706
|
module = payload.module;
|
|
956
|
-
this.
|
|
957
|
-
queueId: queueId,
|
|
958
|
-
module: module,
|
|
707
|
+
var newState = _objectSpread(_objectSpread({}, this.tasks), {}, _defineProperty({}, module, _objectSpread(_objectSpread({}, this.tasks[module]), {}, _defineProperty({}, queueId, _objectSpread(_objectSpread({}, this.tasks[module][queueId]), {}, {
|
|
959
708
|
status: status
|
|
960
|
-
});
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
/**
|
|
964
|
-
* @title: 更新队列运行状态
|
|
965
|
-
* @description: 标记队列是否正在执行
|
|
966
|
-
*/
|
|
967
|
-
}, {
|
|
968
|
-
key: "updateQueueRunningState",
|
|
969
|
-
value: function updateQueueRunningState(payload) {
|
|
970
|
-
var queueId = payload.queueId,
|
|
971
|
-
module = payload.module,
|
|
972
|
-
isRunning = payload.isRunning,
|
|
973
|
-
lastRunAt = payload.lastRunAt;
|
|
974
|
-
this.setTasksData({
|
|
975
|
-
queueId: queueId,
|
|
976
|
-
module: module,
|
|
977
|
-
isRunning: isRunning,
|
|
978
|
-
lastRunAt: lastRunAt
|
|
979
|
-
});
|
|
980
|
-
}
|
|
981
|
-
|
|
982
|
-
// 设置任务
|
|
983
|
-
}, {
|
|
984
|
-
key: "setTasksData",
|
|
985
|
-
value: function setTasksData(payload) {
|
|
986
|
-
var queueId = payload.queueId,
|
|
987
|
-
module = payload.module,
|
|
988
|
-
data = _objectWithoutProperties(payload, _excluded);
|
|
989
|
-
var moduleData = this.tasks[module] || {};
|
|
990
|
-
var queueIdData = moduleData[queueId] || {};
|
|
991
|
-
var newState = _objectSpread(_objectSpread({}, this.tasks), {}, _defineProperty({}, module, _objectSpread(_objectSpread({}, moduleData), {}, _defineProperty({}, queueId, _objectSpread(_objectSpread({}, queueIdData), data)))));
|
|
992
|
-
|
|
709
|
+
})))));
|
|
993
710
|
// 保存任务队列到本地存储
|
|
994
711
|
this.saveTaskQueueToLocal(newState);
|
|
995
712
|
this.tasks = newState;
|
|
@@ -1002,11 +719,15 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
1002
719
|
var queueId = payload.queueId,
|
|
1003
720
|
module = payload.module,
|
|
1004
721
|
tasks = payload.tasks;
|
|
1005
|
-
this.
|
|
1006
|
-
|
|
1007
|
-
|
|
722
|
+
var moduleData = this.tasks[module] || {};
|
|
723
|
+
var queueIdData = moduleData[queueId] || {};
|
|
724
|
+
var newState = _objectSpread(_objectSpread({}, this.tasks), {}, _defineProperty({}, module, _objectSpread(_objectSpread({}, moduleData), {}, _defineProperty({}, queueId, _objectSpread(_objectSpread({}, queueIdData), {}, {
|
|
1008
725
|
tasks: tasks
|
|
1009
|
-
});
|
|
726
|
+
})))));
|
|
727
|
+
|
|
728
|
+
// 保存任务队列到本地存储
|
|
729
|
+
this.saveTaskQueueToLocal(newState);
|
|
730
|
+
this.tasks = newState;
|
|
1010
731
|
}
|
|
1011
732
|
}, {
|
|
1012
733
|
key: "clearAllTaskTimer",
|
|
@@ -1031,12 +752,8 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
1031
752
|
}, {
|
|
1032
753
|
key: "clearTasks",
|
|
1033
754
|
value: function clearTasks(payload) {
|
|
1034
|
-
var _this$tasks2;
|
|
1035
755
|
var queueId = payload.queueId,
|
|
1036
756
|
module = payload.module;
|
|
1037
|
-
if (!((_this$tasks2 = this.tasks) !== null && _this$tasks2 !== void 0 && (_this$tasks2 = _this$tasks2[module]) !== null && _this$tasks2 !== void 0 && _this$tasks2[queueId])) {
|
|
1038
|
-
return;
|
|
1039
|
-
}
|
|
1040
757
|
this.clearAllTaskTimer(this.tasks[module][queueId].tasks);
|
|
1041
758
|
this.tasks[module][queueId].tasks = [];
|
|
1042
759
|
this.saveTaskQueueToLocal(this.tasks);
|
|
@@ -1071,66 +788,6 @@ export var TasksManager = /*#__PURE__*/function () {
|
|
|
1071
788
|
value: function watchTask(callback) {
|
|
1072
789
|
this.watchTaskCallback = callback;
|
|
1073
790
|
}
|
|
1074
|
-
|
|
1075
|
-
/**
|
|
1076
|
-
* @title: 获取队列执行状态
|
|
1077
|
-
* @description: 获取指定队列的执行状态和进度信息
|
|
1078
|
-
* @param {string} module - 模块名
|
|
1079
|
-
* @param {string} queueId - 队列ID
|
|
1080
|
-
* @return {object} 队列状态信息
|
|
1081
|
-
*/
|
|
1082
|
-
}, {
|
|
1083
|
-
key: "getQueueStatus",
|
|
1084
|
-
value: function getQueueStatus(module, queueId) {
|
|
1085
|
-
var _this$tasks$module6, _queue$tasks;
|
|
1086
|
-
var queue = (_this$tasks$module6 = this.tasks[module]) === null || _this$tasks$module6 === void 0 ? void 0 : _this$tasks$module6[queueId];
|
|
1087
|
-
if (!queue) {
|
|
1088
|
-
return null;
|
|
1089
|
-
}
|
|
1090
|
-
return {
|
|
1091
|
-
isRunning: queue.isRunning || false,
|
|
1092
|
-
status: queue.status,
|
|
1093
|
-
progress: queue.progress || {
|
|
1094
|
-
total: 0,
|
|
1095
|
-
completed: 0,
|
|
1096
|
-
failed: 0,
|
|
1097
|
-
inProgress: 0
|
|
1098
|
-
},
|
|
1099
|
-
lastRunAt: queue.lastRunAt || null,
|
|
1100
|
-
tasksCount: ((_queue$tasks = queue.tasks) === null || _queue$tasks === void 0 ? void 0 : _queue$tasks.length) || 0
|
|
1101
|
-
};
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
/**
|
|
1105
|
-
* @title: 获取所有队列状态
|
|
1106
|
-
* @description: 获取所有任务队列的执行状态概览
|
|
1107
|
-
* @return {object} 所有队列的状态信息
|
|
1108
|
-
*/
|
|
1109
|
-
}, {
|
|
1110
|
-
key: "getAllQueuesStatus",
|
|
1111
|
-
value: function getAllQueuesStatus() {
|
|
1112
|
-
var result = {};
|
|
1113
|
-
for (var module in this.tasks) {
|
|
1114
|
-
result[module] = {};
|
|
1115
|
-
for (var queueId in this.tasks[module]) {
|
|
1116
|
-
var _queue$tasks2;
|
|
1117
|
-
var queue = this.tasks[module][queueId];
|
|
1118
|
-
result[module][queueId] = {
|
|
1119
|
-
isRunning: queue.isRunning || false,
|
|
1120
|
-
status: queue.status,
|
|
1121
|
-
progress: queue.progress || {
|
|
1122
|
-
total: 0,
|
|
1123
|
-
completed: 0,
|
|
1124
|
-
failed: 0,
|
|
1125
|
-
inProgress: 0
|
|
1126
|
-
},
|
|
1127
|
-
lastRunAt: queue.lastRunAt || null,
|
|
1128
|
-
tasksCount: ((_queue$tasks2 = queue.tasks) === null || _queue$tasks2 === void 0 ? void 0 : _queue$tasks2.length) || 0
|
|
1129
|
-
};
|
|
1130
|
-
}
|
|
1131
|
-
}
|
|
1132
|
-
return result;
|
|
1133
|
-
}
|
|
1134
791
|
}], [{
|
|
1135
792
|
key: "getInstance",
|
|
1136
793
|
value: function getInstance(app) {
|