Enable restart on failure and optionally exponential backoff #127
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I just implemented part of the changes we were discussing in #45.
I figured out that the stuff I was saying on the
WantedBy=
option does not make sense, since we need the service to start to have flatpaks installed and making theWantedby=
option empty prevents that, even on rebuilds. However, I only used the setup in testing-base/ to verify this.I still wanted to have slightly better resilience to network failures, and the current solution goes hand in hand with the need of having the service started on each activation.
My take on the problem makes the
flatpak-managed-install.service
automatically restart on failure with a customizable delay. The user has also the option to enable an exponential backoff strategy, with a customizable number of steps and maximum restart delay.This has been implemented using the
systemd.service(5)
Restart=
,RestartSec=
,RestartSteps=
andRestartMaxDelaySec=
options.So maybe this plus #110 could be a good solution for the issue mentioned in #45.
Let me know if you have any corrections or opinions, and thinks for considering my contribution!