mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-19 01:35:28 +01:00
Merge branch 'pretzel-fixes' of https://gitlab.com/crafty-controller/crafty-commander into pretzel-fixes
This commit is contained in:
commit
7aebd8bd5b
@ -192,6 +192,14 @@ class helpers_management:
|
||||
Audit_Log.log_msg: audit_msg,
|
||||
Audit_Log.source_ip: source_ip
|
||||
}).execute()
|
||||
#todo make this user configurable
|
||||
#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() > 300:
|
||||
Audit_Log.delete().where(Audit_Log.audit_id == item.audit_id).execute()
|
||||
else:
|
||||
return
|
||||
|
||||
@staticmethod
|
||||
def add_to_audit_log_raw(user_name, user_id, server_id, log_msg, source_ip):
|
||||
@ -202,7 +210,13 @@ class helpers_management:
|
||||
Audit_Log.log_msg: log_msg,
|
||||
Audit_Log.source_ip: source_ip
|
||||
}).execute()
|
||||
|
||||
#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() > 300:
|
||||
Audit_Log.delete().where(Audit_Log.audit_id == item.audit_id).execute()
|
||||
else:
|
||||
return
|
||||
#************************************************************************************************
|
||||
# Schedules Methods
|
||||
#************************************************************************************************
|
||||
|
Loading…
x
Reference in New Issue
Block a user