Skip to content

Automate browser based workflows with AI

rename js sleep to asyncSleepFor (#2016)

Shuchang Zheng915bcfbf13da
diff --git a/skyvern/webeye/scraper/domUtils.js b/skyvern/webeye/scraper/domUtils.js
index 9102299e2..4ba4e4377 100644
--- a/skyvern/webeye/scraper/domUtils.js
+++ b/skyvern/webeye/scraper/domUtils.js
@@ -2165,7 +2165,7 @@ function waitForNextFrame() {
});
}
-function sleep(ms) {
+function asyncSleepFor(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
@@ -2311,7 +2311,7 @@ async function stopGlobalIncrementalObserver() {
(await window.globalParsedElementCounter.get()) <
window.globalOneTimeIncrementElements.length
) {
- await sleep(100);
+ await asyncSleepFor(100);
}
window.globalOneTimeIncrementElements = [];
window.globalDomDepthMap = new Map();
@@ -2322,7 +2322,7 @@ async function getIncrementElements() {
(await window.globalParsedElementCounter.get()) <
window.globalOneTimeIncrementElements.length
) {
- await sleep(100);
+ await asyncSleepFor(100);
}
// cleanup the chidren tree, remove the duplicated element