nixos/pretix: restart web and worker unit on failure

Found a few instances, where celery intermittently complained about a
misconfigured redis instance and exited.

> redis.exceptions.ResponseError: MISCONF Redis is configured to save RDB
> snapshots, but it's currently unable to persist to disk. Commands that
> may modify the data set are disabled, because this instance is
> configured to report errors during writes if RDB snapshotting fails
> (stop-writes-on-bgsave-error option). Please check the Redis logs for
> details about the RDB error.
This commit is contained in:
Martin Weinelt
2024-08-05 17:37:12 +02:00
parent 8ee3bf512b
commit 3dfb2c685a
+5 -1
View File
@@ -538,6 +538,7 @@ in
TimeoutStartSec = "15min";
ExecStart = "${getExe' pythonEnv "gunicorn"} --bind unix:/run/pretix/pretix.sock ${cfg.gunicorn.extraArgs} pretix.wsgi";
RuntimeDirectory = "pretix";
Restart = "on-failure";
};
};
@@ -559,7 +560,10 @@ in
"postgresql.service"
];
wantedBy = [ "multi-user.target" ];
serviceConfig.ExecStart = "${getExe' pythonEnv "celery"} -A pretix.celery_app worker ${cfg.celery.extraArgs}";
serviceConfig = {
ExecStart = "${getExe' pythonEnv "celery"} -A pretix.celery_app worker ${cfg.celery.extraArgs}";
Restart = "on-failure";
};
};
nginx.serviceConfig.SupplementaryGroups = mkIf cfg.nginx.enable [ "pretix" ];