Batch Audit Logs #14
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Instead of sending each audit log immediately, batch them:
class AuditLogger:
def init(self, channel_id: int, batch_size: int = 5, flush_interval: int = 30):
self.channel_id = channel_id
self.batch_size = batch_size
self.flush_interval = flush_interval
self.queue = []
self.last_flush = datetime.now()