Add systemd service to update due date in app

This commit is contained in:
thiloho
2023-11-17 12:18:16 +01:00
parent 5e3300e6ff
commit 1235dab32d
3 changed files with 22 additions and 6 deletions

View File

@@ -144,6 +144,21 @@
Restart = "always";
};
};
todoapp-check-due-dates = {
description = "Set is_overdue for todo in database to true if todo is overdue";
path = [
pkgs.postgresql_15
];
script = ''
psql -d todos -c "UPDATE user_todo SET is_overdue = true WHERE due_date::date < CURRENT_DATE AND is_completed = false AND is_overdue = false"
'';
serviceConfig = {
User = "postgres";
};
wantedBy = ["timers.target"];
partOf = [ "todoapp.service" ];
startAt = "daily";
};
denbot = {
description = "Thilo's Den discord bot";
wantedBy = ["multi-user.target"];