hunter-open-sdk 0.0.13 → 0.0.14
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.
|
@@ -68,10 +68,13 @@ var checkCache = function checkCache() {
|
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
// 轮询检测是否存在进程
|
|
71
|
+
var processCheckTimer = null;
|
|
71
72
|
var checkProcessTimer = function checkProcessTimer() {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
// 清除之前的定时器
|
|
74
|
+
if (processCheckTimer) {
|
|
75
|
+
clearTimeout(processCheckTimer);
|
|
76
|
+
}
|
|
77
|
+
processCheckTimer = setTimeout( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
75
78
|
var hasDriver;
|
|
76
79
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
77
80
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -84,9 +87,14 @@ var checkProcessTimer = function checkProcessTimer() {
|
|
|
84
87
|
_context.next = 6;
|
|
85
88
|
break;
|
|
86
89
|
}
|
|
87
|
-
|
|
90
|
+
// 检测到驱动,清除定时器并返回
|
|
91
|
+
if (processCheckTimer) {
|
|
92
|
+
clearTimeout(processCheckTimer);
|
|
93
|
+
processCheckTimer = null;
|
|
94
|
+
}
|
|
88
95
|
return _context.abrupt("return");
|
|
89
96
|
case 6:
|
|
97
|
+
// 继续轮询检测
|
|
90
98
|
checkProcessTimer();
|
|
91
99
|
case 7:
|
|
92
100
|
case "end":
|