调试音乐延迟
This commit is contained in:
parent
ef5cbad1ef
commit
ff6990e48f
@ -64,7 +64,7 @@ public class MusicService {
|
||||
if (type == 1) {
|
||||
return webClient.get().uri(baseUrl+"/search?keywords="+keyword).retrieve()
|
||||
.bodyToMono(SearchResponse.class)
|
||||
.delaySubscription(Duration.ofMillis(300), Schedulers.boundedElastic())
|
||||
.delaySubscription(Duration.ofMillis(1000), Schedulers.boundedElastic())
|
||||
.flatMap(res -> {
|
||||
if (!Objects.equals(res.getCode(), 200)) {
|
||||
return Mono.empty();
|
||||
@ -91,7 +91,7 @@ public class MusicService {
|
||||
} else {
|
||||
return webClient.get().uri(baseUrl+"/search?keywords="+keyword+"&type=100").retrieve()
|
||||
.bodyToMono(SingerResponse.class)
|
||||
.delaySubscription(Duration.ofMillis(300), Schedulers.boundedElastic())
|
||||
.delaySubscription(Duration.ofMillis(1000), Schedulers.boundedElastic())
|
||||
.flatMap(res -> {
|
||||
if (!Objects.equals(res.getCode(), 200) && res.getResult().getArtists().size() == 0) {
|
||||
return Mono.empty();
|
||||
@ -99,7 +99,7 @@ public class MusicService {
|
||||
String id = res.getResult().getArtists().get(0).getId();
|
||||
return webClient.get().uri(baseUrl+"/artist/top/song?id="+id).retrieve()
|
||||
.bodyToMono(SingerSongsResponse.class)
|
||||
.delaySubscription(Duration.ofMillis(300), Schedulers.boundedElastic())
|
||||
.delaySubscription(Duration.ofMillis(1000), Schedulers.boundedElastic())
|
||||
.flatMap(song -> {
|
||||
if (Objects.equals(200, song.getCode()) && song.getSongs().size() > 0) {
|
||||
String ids = song.getSongs().stream().limit(3)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user