mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-01-02 15:28:42 +08:00
(improvement)(launcher) Optimize demo data loading to avoid repeatedly writing data to mysql (#1236)
* (improvement)(launcher) Optimize demo data loading to avoid repeatedly writing data to mysql Co-authored-by: lxwcodemonkey
This commit is contained in:
@@ -11,6 +11,9 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
@Order(2)
|
||||
@@ -35,6 +38,9 @@ public class SmallTalkDemo extends S2BaseDemo {
|
||||
|
||||
@Override
|
||||
boolean checkNeedToRun() {
|
||||
return true;
|
||||
List<String> agentNames = agentService.getAgents()
|
||||
.stream().map(Agent::getName).collect(Collectors.toList());
|
||||
return !agentNames.contains("来闲聊");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user