Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry saving config files #187

Open
wants to merge 4 commits into
base: 1.20
Choose a base branch
from

Conversation

PoolloverNathan
Copy link

@PoolloverNathan PoolloverNathan commented Feb 22, 2024

Contains a questionable Thread.sleep but it's capped to 25ms and should otherwise be fine. Also exposes the error message to the user.

Copy link
Author

@PoolloverNathan PoolloverNathan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you idiot

@@ -79,6 +79,19 @@ private Path getPath() {
}
}

private void writeWithRetries(Path path, byte[] data, int retries) throws Exception {
try (OutputStream fs = Files.newOutputStream(path)) {

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fs.write(data);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant