| 2511 | ThreadPoolExecutor recoveryExecutor = |
| 2512 | new ExecutorUtil.MDCAwareThreadPoolExecutor( |
| 2513 | 0, |
| 2514 | Integer.MAX_VALUE, |
| 2515 | 1, |
| 2516 | TimeUnit.SECONDS, |
| 2517 | new SynchronousQueue<Runnable>(), |
| 2518 | new SolrNamedThreadFactory("recoveryExecutor")); |
| 2519 | |
| 2520 | public static void deleteFile(Path file) { |
| 2521 | boolean success = false; |
| 2522 | try { |
| 2523 | Files.deleteIfExists(file); |
| 2524 | success = true; |
| 2525 | } catch (Exception e) { |
| 2526 | log.error("Error deleting file: {}", file, e); |
| 2527 | } |
| 2528 | |
| 2529 | if (!success) { |
| 2530 | try { |
| 2531 | PathUtils.deleteOnExit(file); |
| 2532 | } catch (Exception e) { |