mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 03:31:15 +03:00
[FIX] Use custom thread factory in autorefresh
This commit is contained in:
parent
fce8453bd1
commit
9e83e8bec8
1 changed files with 6 additions and 1 deletions
|
@ -37,7 +37,12 @@ public abstract class Request<R extends WebSocketEvent> implements WebSocketRequ
|
||||||
public static synchronized void startAutoRefresh() {
|
public static synchronized void startAutoRefresh() {
|
||||||
if(!autoRefreshRunning) {
|
if(!autoRefreshRunning) {
|
||||||
if(executorService == null) {
|
if(executorService == null) {
|
||||||
executorService = Executors.newSingleThreadScheduledExecutor();
|
executorService = Executors.newSingleThreadScheduledExecutor((t) -> {
|
||||||
|
Thread thread = new Thread(t);
|
||||||
|
thread.setName("AutoRefresh thread");
|
||||||
|
thread.setDaemon(true);
|
||||||
|
return thread;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
executorService.scheduleAtFixedRate(() -> {
|
executorService.scheduleAtFixedRate(() -> {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue