Skip to content

CloseAndFlush don't work #23

@0n2ynu

Description

@0n2ynu

  protected override async void OnExit(ExitEventArgs e)
        {
            try
            {
                _mutex?.ReleaseMutex();
                _mutex?.Close();
            }
            catch (Exception)
            {
                // ignored
            }
            finally
            {
                if (e.ApplicationExitCode == 0)
                {
                    Log.Information("exit");
                    await Log.CloseAndFlushAsync();
                    await Dal.DalBase.Save2DbAsync(new ActionLog("exit"));
                }

                base.OnExit(e);
            }

Always miss the last few message in mysql . And i find out that sink to file is ok. Seems CloseAndFlushAsync() has some issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions