aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2024-07-24 20:39:43 +0200
committerGravatar Johannes Christ <[email protected]>2024-08-22 20:12:21 +0200
commit07cb684a49d1eaabb4367064be93aafbd56d0b04 (patch)
tree69f6f4d5de3de11f23e3fd3772b4bd1bb5f89ff6
parentRemove now obsolete sed call (diff)
Perform final polish
Name the state directory to mark that it's a Python Discord-related service, and remove the IOSchedulingClass setting.
-rw-r--r--ansible/roles/rrdstats/templates/generate-rrdtool-stats.service.j24
-rw-r--r--ansible/roles/rrdstats/templates/generate-rrdtool-stats.sh.j28
2 files changed, 5 insertions, 7 deletions
diff --git a/ansible/roles/rrdstats/templates/generate-rrdtool-stats.service.j2 b/ansible/roles/rrdstats/templates/generate-rrdtool-stats.service.j2
index 5122e84..b185bb2 100644
--- a/ansible/roles/rrdstats/templates/generate-rrdtool-stats.service.j2
+++ b/ansible/roles/rrdstats/templates/generate-rrdtool-stats.service.j2
@@ -7,7 +7,7 @@ Requires = postgresql.service
[Service]
ExecStart = {{ rrdstats_script_path }}
DynamicUser = true
-Statedirectory = rrdstats
+StateDirectory = pydis-rrdstats
User = pydis-rrdstats
EnvironmentFile = {{ rrdstats_env_path }}
@@ -18,8 +18,6 @@ NoNewPrivileges = true
# Most of the resource expenditure of this unit will be dished out in the psql connection.
# The rest here is just to ensure it doesn't impede the server's stability.
Nice = 10
-# Default of 6
-IOSchedulingClass = 5
CPUQuota = 10%
MemoryMax = 100M
TasksMax = 20
diff --git a/ansible/roles/rrdstats/templates/generate-rrdtool-stats.sh.j2 b/ansible/roles/rrdstats/templates/generate-rrdtool-stats.sh.j2
index d2b9b82..072f612 100644
--- a/ansible/roles/rrdstats/templates/generate-rrdtool-stats.sh.j2
+++ b/ansible/roles/rrdstats/templates/generate-rrdtool-stats.sh.j2
@@ -113,11 +113,11 @@ psql --tuples-only --csv "$DB_DSN" -c "
# Threads
psql --tuples-only --csv "$DB_DSN" -c "
WITH threads_by_archived AS (
- SELECT CASE WHEN archived THEN 'archived'
- ELSE 'unarchived'
- END AS archived
+ SELECT CASE WHEN archived THEN 'archived'
+ ELSE 'unarchived'
+ END AS archived
FROM threads
- )
+ )
SELECT COUNT(*), archived FROM threads_by_archived GROUP BY archived
" | awk -F, '
BEGIN {