Skip to content

Commit 096009a

Browse files
committed
Replace hasRetried flag with attempts counter for deployment retries
1 parent 8f6a655 commit 096009a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/utils/Builder.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class Builder {
7474
private autoDeployBuildType: 'Fast' | 'Maven' | 'Gradle';
7575
private autoDeployMode: 'On Save' | 'On Shortcut' | 'Disabled';
7676
private isDeploying = false;
77-
private hasRetried = false;
77+
private attempts = 0;
7878

7979
/**
8080
* Private constructor for Singleton pattern
@@ -237,13 +237,13 @@ export class Builder {
237237
await new Promise(resolve => setTimeout(resolve, 100));
238238
Browser.getInstance().run(appName);
239239
}
240-
241-
this.hasRetried = false;
240+
241+
this.attempts = 0;
242242
} catch (err) {
243243
const errorMessage = err instanceof Error ? err.message : String(err);
244244
const isBusyError = errorMessage.includes('EBUSY') || errorMessage.includes('resource busy or locked');
245-
if (isBusyError && !this.hasRetried) {
246-
this.hasRetried = true;
245+
if (isBusyError && this.attempts < 3) {
246+
this.attempts++;
247247
await tomcat.kill();
248248
this.deploy(type);
249249
} else {

0 commit comments

Comments
 (0)