The query used to delete audit logs has been simplified, and optimized with the added index
An app-wide default for the number of days to keep is set in the runtime.exs config
But the max_records_per_run to delete has been removed
Each Org can be set a custom number of days of audit logs to keep by setting audit_log_days_to_keep on the Org
I decided not to add a way for the Org admin to change the number of days of audit logs to keep because an Org admin will always want to keep as many audit logs as possible. If the platform admin wants to set this to less or more days then they will do it application wide, or they can change this on an Org level via the DB if they want.
This addresses https://github.com/nerves-hub/nerves_hub_web/issues/795
A few highlights:
runtime.exs
configmax_records_per_run
to delete has been removedaudit_log_days_to_keep
on the OrgI decided not to add a way for the Org admin to change the number of days of audit logs to keep because an Org admin will always want to keep as many audit logs as possible. If the platform admin wants to set this to less or more days then they will do it application wide, or they can change this on an Org level via the DB if they want.