Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CloseAndFlush don't work #23

Open
0n2ynu opened this issue Oct 23, 2023 · 0 comments
Open

CloseAndFlush don't work #23

0n2ynu opened this issue Oct 23, 2023 · 0 comments

Comments

@0n2ynu
Copy link

0n2ynu commented Oct 23, 2023


  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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant