Skip to content

Enable streaming of audit events without the need to save them to database

Description

  • This issue has been created as a result of this comment.
  • We need to allow the AuditEventStreamingWorker to either expect an id or a json string of AuditEvent instance. This will enable us to build an AuditEvent (not save it) and stream it to the destination.

Proposal

  1. Modify AuditEventStreamingWorker to accept either an id of an audit_event in the database or json string of an instance of AuditEvent.
  2. We can then use AuditEvents::AuditEventStreamingWorker.perform_async(nil, audit_event_json) to stream the audit_event that is not saved in the database.
Edited by Harsimar Sandhu