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

Remove delayed job #13

Merged
merged 1 commit into from
Oct 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 1 addition & 32 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,6 @@ in
type = types.listOf types.str;
};

delayedJobWorkers = mkOption {
description = ''
Amount of background workers using Delayed Job that should be spawned.

This option is deprecated and should only be used to finish working existing jobs.
'';
default = 4;
example = 8;
type = types.int;
};

environmentFile = mkOption {
description = ''
Path to a file containing secret environment variables that should be
Expand Down Expand Up @@ -203,27 +192,7 @@ in
})
cfg.workers
))
// (builtins.foldl' (x: y: x // y) { } (builtins.genList
(n: {
"accentor-worker-delayed${toString n}" = {
after = [ "network.target" "accentor-api.service" "postgresql.service" ];
requires = [ "postgresql.service" ];
wantedBy = [ "multi-user.target" ];
environment = env;
path = [ pkgs.ffmpeg gems gems.wrappedRuby ];
serviceConfig = {
EnvironmentFile = cfg.environmentFile;
Type = "simple";
User = "accentor";
Group = "accentor";
Restart = "on-failure";
WorkingDirectory = api;
ExecStart = "${gems}/bin/bundle exec rails jobs:work";
};
};

})
cfg.delayedJobWorkers)) // lib.optionalAttrs cfg.rescanTimer.enable {
// lib.optionalAttrs cfg.rescanTimer.enable {
accentor-rescan = {
description = "Accentor rescan";
restartIfChanged = false;
Expand Down
Loading