mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-02-26 21:18:18 +00:00
Delete summary entries older than 7 days. To be made configurable in future version
This commit is contained in:
parent
6c08240ce1
commit
faa204743d
1 changed files with 4 additions and 0 deletions
|
@ -48,6 +48,10 @@ with conn:
|
|||
'''
|
||||
c.execute(gt)
|
||||
|
||||
#Delete entries more than 7 days old. TODO: make this a configurable number in /etc/pihole/setupVars.conf
|
||||
sql = "DELETE FROM summaries WHERE ts <= date('now', '-7 day')"
|
||||
c.execute(sql);
|
||||
|
||||
#Insert values into summaries table
|
||||
sql = "INSERT INTO summaries (ts, domains_being_blocked, dns_queries_today, ads_blocked_today, ads_percentage_today) VALUES (?,?,?,?,?)"
|
||||
c.execute(sql, (datetime.now(), api_domains_being_blocked, api_dns_queries_today, api_ads_blocked_today, api_ads_percentage_today))
|
||||
|
|
Loading…
Add table
Reference in a new issue