|
@@ -18,6 +18,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import com.chelvc.framework.base.context.ApplicationContextHolder;
|
|
|
import com.chelvc.framework.base.context.ThreadContextHolder;
|
|
|
import com.chelvc.framework.base.util.HttpUtils;
|
|
|
+import com.chelvc.framework.common.function.Executor;
|
|
|
import com.chelvc.framework.common.util.AssertUtils;
|
|
|
import com.chelvc.framework.common.util.ExcelUtils;
|
|
|
import com.chelvc.framework.common.util.FileUtils;
|
|
@@ -127,11 +128,11 @@ public class DefaultExportHandler implements ExportHandler {
|
|
|
ThreadUtils.run(() -> {
|
|
|
while (!Thread.currentThread().isInterrupted()) {
|
|
|
try {
|
|
|
- this.clear();
|
|
|
+ RedisContextHolder.tryLockAround("exporting:clear:lock", (Executor) this::clear);
|
|
|
} catch (Exception e) {
|
|
|
log.error("Export file clear failed", e);
|
|
|
}
|
|
|
- ThreadUtils.sleep(60 * 1000);
|
|
|
+ ThreadUtils.sleep(this.duration.toMillis());
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -190,7 +191,7 @@ public class DefaultExportHandler implements ExportHandler {
|
|
|
try {
|
|
|
listener.accept(id, volume);
|
|
|
} catch (Exception e) {
|
|
|
- log.error("Export listener callback failed", e);
|
|
|
+ log.error("Export listening failed", e);
|
|
|
}
|
|
|
});
|
|
|
return id;
|