feat: add autonomous fiscal control panel
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
"""Expire eligible operational events; audit and critical events are preserved."""
|
||||
|
||||
import argparse
|
||||
|
||||
from central.app.db import SessionLocal
|
||||
from central.app.events import purge_expired_events
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--dry-run", action="store_true")
|
||||
parser.add_argument("--retention-days", type=int, default=None)
|
||||
args = parser.parse_args()
|
||||
if args.dry_run:
|
||||
print("dry-run: no events deleted")
|
||||
return
|
||||
with SessionLocal() as session:
|
||||
print(f"deleted_events={purge_expired_events(session, retention_days=args.retention_days)}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user