Procházet zdrojové kódy

Add cron for deleting old notifications from DB (#50)

Merge branch 'master' into kris/clear_old_notifications

Add cron for deleting old notifications from DB

Co-authored-by: jonathan <jonathan@noreply.git.bubblev.org>
Co-authored-by: Kristijan Mitrovic <kmitrovic@itekako.com>
Reviewed-on: #50
tags/v1.1.0
Kristijan Mitrovic před 4 roky
committed by jonathan
rodič
revize
d4d4d98097
1 změnil soubory, kde provedl 7 přidání a 0 odebrání
  1. +7
    -0
      bubble-server/src/main/resources/packer/roles/bubble/tasks/postgresql.yml

+ 7
- 0
bubble-server/src/main/resources/packer/roles/bubble/tasks/postgresql.yml Zobrazit soubor

@@ -29,3 +29,10 @@
group: postgres
mode: 0400
when: install_type == 'sage'

- name: Install notifications tables' cleaner cron
cron:
name: "Cleaning notifications tables"
special_time: "hourly"
user: "postgres"
job: "HOUR_AGO=$(date -d '1 month ago' +\"%s000\") && psql -d bubble -c \"DELETE FROM sent_notification WHERE mtime < ${HOUR_AGO}\" -c \"DELETE FROM received_notification WHERE mtime < ${HOUR_AGO}\""

Načítá se…
Zrušit
Uložit