fix: 空闲时轻量刷新外部构建状态
- 部署中每 12 秒刷新,空闲时每分钟刷新,隐藏页面暂停请求。 - 更新 Jenkins 自动发现与生产验证说明。
This commit is contained in:
@@ -23,6 +23,7 @@ const canPublish = computed(() =>
|
||||
)
|
||||
let timer: ReturnType<typeof setInterval> | undefined
|
||||
let refreshing = false
|
||||
let lastAutoRefreshAt = Date.now()
|
||||
async function refresh() {
|
||||
try {
|
||||
await platform.loadAll()
|
||||
@@ -35,7 +36,9 @@ onMounted(() => {
|
||||
assistant.reset()
|
||||
void refresh()
|
||||
timer = setInterval(async () => {
|
||||
if (document.hidden || !platform.runningRuns.length || refreshing || platform.loading) return
|
||||
if (document.hidden || refreshing || platform.loading) return
|
||||
if (!platform.runningRuns.length && Date.now() - lastAutoRefreshAt < 60_000) return
|
||||
lastAutoRefreshAt = Date.now()
|
||||
refreshing = true
|
||||
try {
|
||||
await platform.refreshRuns()
|
||||
|
||||
Reference in New Issue
Block a user