Skip to content

Commit 717a377

Browse files
committed
Fixing rm flag status
1 parent 424e96f commit 717a377

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/main/java/picoded/dstack/mongodb/MongoDB_FileWorkspaceMap.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,16 +304,18 @@ protected boolean removeFilePath(String oid, String path) {
304304
GridFSFindIterable search = gridFSBucket.find(query);
305305

306306
// Lets iterate the search result, and return true on an item
307+
boolean rmFlag = false;
307308
try (MongoCursor<GridFSFile> cursor = search.iterator()) {
308309
while (cursor.hasNext()) {
309310
GridFSFile fileObj = cursor.next();
310311
gridFSBucket.delete(fileObj.getId());
312+
313+
rmFlag = true;
311314
}
312-
return true;
313315
}
314316

315-
// removal didn't occur
316-
return false;
317+
// Return the remove status
318+
return rmFlag;
317319
}
318320

319321
//--------------------------------------------------------------------------

0 commit comments

Comments
 (0)