Skip to content

Is it possible to enqueue the Audit to be processed later? #639

Closed Answered by thepirat000
Ewerton asked this question in Q&A
Discussion options

You must be logged in to vote

I can't advise since there are many things to consider depending on your use cases.

But I can give you some examples.

A simple fire-and-forget mechanism can be achieved by creating a custom data provider that inherits from the real data provider and overrides the Insert methods to execute the insert in a different thread:

public class FireAndForgetPostgreSqlDataProvider : PostgreSqlDataProvider
{
    public FireAndForgetPostgreSqlDataProvider(Action<IPostgreSqlProviderConfigurator> c) : base(c) { }

    public override object InsertEvent(AuditEvent auditEvent)
    {
        Task.Run(() =>
        {
            try
            {
                base.InsertEvent(auditEvent);
            }

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Ewerton
Comment options

@thepirat000
Comment options

Answer selected by Ewerton
@Ewerton
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants