MCPcopy Create free account
hub / github.com/elastic/eui / removeWithRetry

Function removeWithRetry

packages/eui/scripts/compile-eui.js:301–319  ·  view source on GitHub ↗
(targetPath)

Source from the content-addressed store, hash-verified

299
300async function cleanup() {
301 const removeWithRetry = async (targetPath) => {
302 for (let attempt = 0; attempt <= CLEANUP_MAX_RETRIES; attempt++) {
303 try {
304 await fs.rm(targetPath, {
305 recursive: true,
306 force: true,
307 });
308 return;
309 } catch (error) {
310 const shouldRetry =
311 (error?.code === 'ENOTEMPTY' || error?.code === 'EBUSY') &&
312 attempt < CLEANUP_MAX_RETRIES;
313
314 if (!shouldRetry) throw error;
315
316 await new Promise((resolve) => setTimeout(resolve, CLEANUP_RETRY_DELAY_MS));
317 }
318 }
319 };
320
321 for (const dir of buildDirs) {
322 await removeWithRetry(path.join(packageRootDir, dir));

Callers 1

cleanupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…