mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-14 16:14:50 +00:00
Merge pull request #132312 from ncfavier/syncthing-init
nixos/syncthing: fix curl not retrying on network errors
This commit is contained in:
commit
3b4f4560d2
@ -37,13 +37,9 @@ let
|
|||||||
do sleep 1; done
|
do sleep 1; done
|
||||||
|
|
||||||
curl() {
|
curl() {
|
||||||
while
|
${pkgs.curl}/bin/curl -sS -H "X-API-Key: $api_key" \
|
||||||
${pkgs.curl}/bin/curl -Ss -H "X-API-Key: $api_key" \
|
--retry 1000 --retry-delay 1 --retry-all-errors \
|
||||||
--retry 100 --retry-delay 1 --retry-connrefused "$@"
|
"$@"
|
||||||
status=$?
|
|
||||||
[ "$status" -eq 52 ] # retry on empty reply from server
|
|
||||||
do sleep 1; done
|
|
||||||
return "$status"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# query the old config
|
# query the old config
|
||||||
@ -547,6 +543,7 @@ in {
|
|||||||
cfg.devices != {} || cfg.folders != {} || cfg.extraOptions != {}
|
cfg.devices != {} || cfg.folders != {} || cfg.extraOptions != {}
|
||||||
) {
|
) {
|
||||||
description = "Syncthing configuration updater";
|
description = "Syncthing configuration updater";
|
||||||
|
requisite = [ "syncthing.service" ];
|
||||||
after = [ "syncthing.service" ];
|
after = [ "syncthing.service" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user