This commit is contained in:
Andrea Cavalli 2021-05-08 03:09:49 +02:00
parent 91ec8d6609
commit ec8505b102
2 changed files with 8 additions and 6 deletions

View File

@ -31,6 +31,7 @@ import it.cavallium.dbengine.database.LLDictionary;
import it.cavallium.dbengine.database.LLDictionaryResultType;
import it.cavallium.dbengine.database.LLKeyValueDatabase;
import it.cavallium.dbengine.database.UpdateMode;
import it.cavallium.dbengine.database.UpdateReturnMode;
import it.unimi.dsi.fastutil.booleans.BooleanArrayList;
import java.nio.ByteBuffer;
import java.util.Arrays;
@ -85,7 +86,7 @@ public class DiskCache implements URLsDiskHandler, URLsWriter {
BooleanArrayList.wrap(new boolean[DiskMetadata.getBlocksCount(metadata.getSize(), BLOCK_SIZE)])
));
}
})
}, UpdateReturnMode.NOTHING)
.then();
}
@ -118,7 +119,7 @@ public class DiskCache implements URLsDiskHandler, URLsWriter {
} else {
return null;
}
}))
}, UpdateReturnMode.NOTHING))
.then();
}

View File

@ -45,17 +45,18 @@ public class FileSpongeUtils {
}
private static <T> Mono<T> ignoreFakeErrors(Throwable ex) {
return Mono.defer(() -> {
return Mono.create(sink -> {
if (ex instanceof NoSuchElementException) {
var multiple = Exceptions.unwrapMultiple(ex.getCause());
for (Throwable throwable : multiple) {
if (!(throwable instanceof NoSuchElementException)) {
return Mono.error(ex);
sink.error(ex);
return;
}
}
return Mono.empty();
sink.success();
} else {
return Mono.error(ex);
sink.error(ex);
}
});
}