Use flatMapIterable when possible
This commit is contained in:
parent
a840df8ed3
commit
21097c5135
|
@ -78,11 +78,11 @@ public class BinlogUtils {
|
|||
.rxReadFile(binlogPath.toString()).as(MonoUtils::toMono)
|
||||
.flatMap(buffer -> vertxFilesystem
|
||||
.rxReadDir(sessionPath.toString(), "^(?!td.binlog$).*").as(MonoUtils::toMono)
|
||||
.flatMapMany(Flux::fromIterable)
|
||||
.flatMapIterable(list -> list)
|
||||
.doOnNext(file -> logger.debug("Deleting session file {}", file))
|
||||
.flatMap(file -> vertxFilesystem.rxDeleteRecursive(file, true).as(MonoUtils::toMono))
|
||||
.then(vertxFilesystem.rxReadDir(mediaPath.toString(), "^(?!td.binlog$).*").as(MonoUtils::toMono))
|
||||
.flatMapMany(Flux::fromIterable)
|
||||
.flatMapIterable(list -> list)
|
||||
.doOnNext(file -> logger.debug("Deleting media file {}", file))
|
||||
.flatMap(file -> vertxFilesystem.rxDeleteRecursive(file, true).as(MonoUtils::toMono))
|
||||
.onErrorResume(ex -> Mono.empty())
|
||||
|
|
Loading…
Reference in New Issue