|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2023 the original author or authors. |
| 2 | + * Copyright 2002-2024 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -606,9 +606,9 @@ public CompletableFuture<TestBean> insertItem(TestBean item) {
|
606 | 606 | return CompletableFuture.completedFuture(item);
|
607 | 607 | }
|
608 | 608 |
|
609 |
| - @CacheEvict(cacheNames = "itemCache", allEntries = true) |
610 |
| - public CompletableFuture<Void> clear() { |
611 |
| - return CompletableFuture.completedFuture(null); |
| 609 | + @CacheEvict(cacheNames = "itemCache", allEntries = true, condition = "#result > 0") |
| 610 | + public CompletableFuture<Integer> clear() { |
| 611 | + return CompletableFuture.completedFuture(1); |
612 | 612 | }
|
613 | 613 | }
|
614 | 614 |
|
@@ -655,9 +655,9 @@ public Mono<TestBean> insertItem(TestBean item) {
|
655 | 655 | return Mono.just(item);
|
656 | 656 | }
|
657 | 657 |
|
658 |
| - @CacheEvict(cacheNames = "itemCache", allEntries = true) |
659 |
| - public Mono<Void> clear() { |
660 |
| - return Mono.empty(); |
| 658 | + @CacheEvict(cacheNames = "itemCache", allEntries = true, condition = "#result > 0") |
| 659 | + public Mono<Integer> clear() { |
| 660 | + return Mono.just(1); |
661 | 661 | }
|
662 | 662 | }
|
663 | 663 |
|
@@ -706,9 +706,9 @@ public Flux<TestBean> insertItem(String id, List<TestBean> item) {
|
706 | 706 | return Flux.fromIterable(item);
|
707 | 707 | }
|
708 | 708 |
|
709 |
| - @CacheEvict(cacheNames = "itemCache", allEntries = true) |
710 |
| - public Flux<Void> clear() { |
711 |
| - return Flux.empty(); |
| 709 | + @CacheEvict(cacheNames = "itemCache", allEntries = true, condition = "#result > 0") |
| 710 | + public Flux<Integer> clear() { |
| 711 | + return Flux.just(1); |
712 | 712 | }
|
713 | 713 | }
|
714 | 714 |
|
|
0 commit comments