Skip to content

Commit 17978ac

Browse files
committed
don’t thread
1 parent 927ef6e commit 17978ac

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/main/java/com/lowtuna/jsonblob/core/BlobCleanupJob.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ public void run() {
4646

4747
if (localDate.isBefore(LocalDate.now().minusDays(blobAccessTtl.toDays()))) {
4848
log.debug("Submitting DataDirectoryCleanupJob for {}", dataDirPath);
49-
executorService.submit(new DataDirectoryCleanupJob(dataDirPath, executorService, fileSystemJsonBlobManager, blobAccessTtl, om, deleteEnabled));
49+
DataDirectoryCleanupJob cleanupJob = new DataDirectoryCleanupJob(dataDirPath, executorService, fileSystemJsonBlobManager, blobAccessTtl, om, deleteEnabled);
50+
cleanupJob.run();
51+
// executorService.submit(cleanupJob);
5052
}
5153
}
5254
} catch (Exception e) {

src/main/java/com/lowtuna/jsonblob/core/DataDirectoryCleanupJob.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ public DateTime apply(@Nullable String input) {
7878

7979
log.debug("Submitting BulkBlobDeleteJobs for {} blobs in {}", toRemove.size(), dir);
8080
List<List<String>> subSets = Lists.partition(Lists.newArrayList(toRemove.keySet()), 1000);
81-
subSets.parallelStream().forEach(list -> executorService.submit(new BulkBlobDeleteJob(Sets.newHashSet(list), fileSystemJsonBlobManager, deleteEnabled)));
81+
subSets.parallelStream().forEach(list -> {
82+
BulkBlobDeleteJob deleteJob = new BulkBlobDeleteJob(Sets.newHashSet(list), fileSystemJsonBlobManager, deleteEnabled);
83+
deleteJob.run();
84+
// executorService.submit(deleteJob);
85+
});
8286
} catch (IOException e) {
8387
log.warn("Couldn't load metadata file from {}", dir.getAbsolutePath(), e);
8488
}

0 commit comments

Comments
 (0)