mirror of
https://gitee.com/juicedata/JuiceFS.git
synced 2025-12-06 17:49:22 +08:00
hadoop: use daemon thread to run trash emptier (#6351)
This commit is contained in:
@@ -128,7 +128,11 @@ public class BgTaskUtil {
|
||||
String key = name + "|" + "Trash emptier";
|
||||
if (!tasks.containsKey(key)) {
|
||||
LOG.debug("run trash emptier for {}", name);
|
||||
ScheduledExecutorService thread = Executors.newScheduledThreadPool(1);
|
||||
ScheduledExecutorService thread = Executors.newScheduledThreadPool(1, r -> {
|
||||
Thread t = new Thread(r, "JuiceFS Trash Emptier");
|
||||
t.setDaemon(true);
|
||||
return t;
|
||||
});
|
||||
thread.schedule(emptierTask, delay, unit);
|
||||
tasks.put(key, thread);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user