add delay for no position when have traversed all job

This commit is contained in:
geekgeekrun
2025-04-26 11:08:51 +08:00
parent 7f21ea8c95
commit 8347fb0f77
@@ -750,6 +750,8 @@ async function toRecommendPage (hooks) {
currentExceptJobIndex + 1 >= expectJobList.length currentExceptJobIndex + 1 >= expectJobList.length
) { ) {
hooks.noPositionFoundForCurrentJob?.call() hooks.noPositionFoundForCurrentJob?.call()
hooks.noPositionFoundAfterTraverseAllJob?.call()
await sleep((20 + 30 * Math.random()) * 1000)
await Promise.all([ await Promise.all([
page.reload(), page.reload(),
page.waitForNavigation() page.waitForNavigation()
@@ -757,8 +759,7 @@ async function toRecommendPage (hooks) {
currentExceptJobIndex = INIT_START_EXCEPT_JOB_INDEX currentExceptJobIndex = INIT_START_EXCEPT_JOB_INDEX
} else { } else {
hooks.noPositionFoundForCurrentJob?.call() hooks.noPositionFoundForCurrentJob?.call()
hooks.noPositionFoundAfterTraverseAllJob?.call() await sleep((10 + 15 * Math.random()) * 1000)
currentExceptJobIndex += 1 currentExceptJobIndex += 1
} }
} }