Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 75b4ec1d
authored
May 02, 2026
by
Jaxon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix(libs/interval): 修复轮询错误时未清理定时器的问题
1 parent
eaca37ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
src/libs/interval.js
src/libs/interval.js
View file @
75b4ec1
...
...
@@ -27,6 +27,9 @@ export function startPolling(requestFn, interval = 3000, stopCondition = () => f
}
catch
(
error
)
{
console
.
error
(
"轮询请求发生错误:"
,
error
);
// 发生错误时默认继续轮询,如果需要错误时停止,可以在 stopCondition 中处理,或者在这里加配置
if
(
timer
)
{
clearTimeout
(
timer
);
}
}
// 安排下一次执行
if
(
!
isStopped
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment