Skip to content

Commit 1f8cd55

Browse files
committed
handle the timeout correctly
1 parent 971b390 commit 1f8cd55

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ public void run() {
3131
log.info("Polling queue for files to process for {}", QUEUE_TIMEOUT);
3232
try {
3333
File file = filesToProcess.poll(QUEUE_TIMEOUT.getQuantity(), QUEUE_TIMEOUT.getUnit());
34+
if (file == null) {
35+
log.info("Timed out after {} while waiting for something to come onto the queue", QUEUE_TIMEOUT);
36+
return;
37+
}
3438
log.debug("Processing {}", file.getAbsolutePath());
3539
String blobId = file.getName().split("\\.", 2)[0];
3640
File metadataFile = fileSystemJsonBlobManager.getMetaDataFile(file.getParentFile());

0 commit comments

Comments
 (0)