We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c2b85f commit ccb07b3Copy full SHA for ccb07b3
puppet/lib/launchProcess.ts
@@ -115,10 +115,20 @@ export default async function launchProcess(
115
} else {
116
launchedProcess.kill('SIGKILL');
117
}
118
- if (dataDir) Fs.rmdirSync(dataDir, { recursive: true });
+ if (dataDir) cleanDataDir(dataDir);
119
return closed;
120
} catch (error) {
121
// might have already been kill off
122
123
124
+
125
+ function cleanDataDir(datadir: string, retries = 3): void {
126
+ try {
127
+ if (Fs.existsSync(datadir)) Fs.rmdirSync(dataDir, { recursive: true });
128
+ } catch (err) {
129
+ if (retries >= 0) {
130
+ cleanDataDir(datadir, retries - 1);
131
+ }
132
133
134
0 commit comments