Fix the problem of getting stuck on VM exit (#2919)

#### What type of PR is this?

/kind bug
/area core

#### What this PR does / why we need it:

Shutdown AsyncLogWriter on VM exit.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2901

#### Does this PR introduce a user-facing change?

```release-note
None
```
pull/2923/head
John Niang 2022-12-12 16:06:42 +08:00 committed by GitHub
parent 52906f21c1
commit cfb66b0faa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ public class VisitLogWriter implements InitializingBean, DisposableBean {
this.started = false; this.started = false;
interruptThread = true; interruptThread = true;
asyncLogWriter.dispose(); asyncLogWriter.dispose();
executorService.shutdown(); executorService.shutdownNow();
} }
static class AsyncLogWriter implements Disposable { static class AsyncLogWriter implements Disposable {