mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Delete audit logs when they exceed 300 entries
This commit is contained in:
parent
7889ca3153
commit
184a042e2a
@ -195,7 +195,7 @@ class helpers_management:
|
||||
#deletes records when they're more than 100
|
||||
ordered = Audit_Log.select().order_by(+Audit_Log.created)
|
||||
for item in ordered:
|
||||
if Audit_Log.select().count() > 100:
|
||||
if Audit_Log.select().count() > 300:
|
||||
Audit_Log.delete().where(Audit_Log.audit_id == item.audit_id).execute()
|
||||
else:
|
||||
return
|
||||
@ -212,7 +212,7 @@ class helpers_management:
|
||||
#deletes records when they're more than 100
|
||||
ordered = Audit_Log.select().order_by(+Audit_Log.created)
|
||||
for item in ordered:
|
||||
if Audit_Log.select().count() > 100:
|
||||
if Audit_Log.select().count() > 300:
|
||||
Audit_Log.delete().where(Audit_Log.audit_id == item.audit_id).execute()
|
||||
else:
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user