Skip to content

Commit

Permalink
fix: some issue
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengziyi committed Oct 30, 2024
1 parent cacaa4e commit e66546a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ public class AsyncProfilerTask {
private static String execute(AsyncProfiler asyncProfiler, String args)
throws IllegalArgumentException, IOException {
LOGGER.info("async profiler execute args:{}", args);
String result = asyncProfiler.execute(args);
return result.trim();
return asyncProfiler.execute(args);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class AsyncProfilerTaskExecutionService implements BootService {

private static final AsyncProfiler ASYNC_PROFILER = AsyncProfiler.getInstance();

private static final String SUCCESS_RESULT = "Profiling started";
private static final String SUCCESS_RESULT = "Profiling started\n";

// profile executor thread pool, only running one thread
private static final ScheduledExecutorService ASYNC_PROFILER_EXECUTOR = Executors.newSingleThreadScheduledExecutor(
Expand Down Expand Up @@ -133,8 +133,10 @@ public void onComplete() throws Throwable {

@Override
public void shutdown() throws Throwable {
scheduledFuture.cancel(true);
ASYNC_PROFILER_EXECUTOR.shutdown();
scheduledFuture = null;
if (Objects.nonNull(scheduledFuture)) {
scheduledFuture.cancel(true);
scheduledFuture = null;
}
}
}

0 comments on commit e66546a

Please sign in to comment.