AshAuthentication.AuditLogResource.Batcher (ash_authentication v4.13.3)
View SourceA GenServer which batches up writes to the audit log to reduce write pressure in busy environments.
Scans all audit log resources based on their configured write batching options.
defmodule MyApp.Accounts.AuditLog do
use Ash.Resource,
extensions: [AshAuthentication.AuditLogResource],
domain: MyApp.Accounts
audit_log do
write_batching do
enabled? true
timeout :timer.seconds(10)
max_size 100
end
end
endThis GenServer is started by the AshAuthentication.Supervisor which should be added to your app's supervision tree.
Summary
Functions
Returns a specification to start this module under a supervisor.
Queues an event for writing.
Flushes all queued events to the database immediately.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Queues an event for writing.
Flushes all queued events to the database immediately.
Useful for testing to ensure all audit log entries are written before assertions.