Merge pull request #132312 from ncfavier/syncthing-init

nixos/syncthing: fix curl not retrying on network errors

authored by

Lassulus and committed by
GitHub
3b4f4560 c649b936

+4 -7
+4 -7
nixos/modules/services/networking/syncthing.nix
··· 37 do sleep 1; done 38 39 curl() { 40 - while 41 - ${pkgs.curl}/bin/curl -Ss -H "X-API-Key: $api_key" \ 42 - --retry 100 --retry-delay 1 --retry-connrefused "$@" 43 - status=$? 44 - [ "$status" -eq 52 ] # retry on empty reply from server 45 - do sleep 1; done 46 - return "$status" 47 } 48 49 # query the old config ··· 547 cfg.devices != {} || cfg.folders != {} || cfg.extraOptions != {} 548 ) { 549 description = "Syncthing configuration updater"; 550 after = [ "syncthing.service" ]; 551 wantedBy = [ "multi-user.target" ]; 552
··· 37 do sleep 1; done 38 39 curl() { 40 + ${pkgs.curl}/bin/curl -sS -H "X-API-Key: $api_key" \ 41 + --retry 1000 --retry-delay 1 --retry-all-errors \ 42 + "$@" 43 } 44 45 # query the old config ··· 543 cfg.devices != {} || cfg.folders != {} || cfg.extraOptions != {} 544 ) { 545 description = "Syncthing configuration updater"; 546 + requisite = [ "syncthing.service" ]; 547 after = [ "syncthing.service" ]; 548 wantedBy = [ "multi-user.target" ]; 549