mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
fix for the duplicate key error. The changes prevent duplicate plugin mappings from being inserted when creating new agents.
This commit is contained in:
parent
43f111af9a
commit
fc526d12f0
6 changed files with 37 additions and 13 deletions
27
ecosystem.config.js
Normal file
27
ecosystem.config.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
module.exports = {
|
||||
apps: [
|
||||
{
|
||||
name: "manager-api",
|
||||
script: "mvn",
|
||||
args: "spring-boot:run",
|
||||
cwd: "/root/xiaozhi-esp32-server/main/manager-api",
|
||||
interpreter: "none" // important, tells PM2 not to use node/python
|
||||
},
|
||||
{
|
||||
name: "manager-web",
|
||||
script: "npm",
|
||||
args: "run serve",
|
||||
cwd: "/root/xiaozhi-esp32-server/main/manager-web",
|
||||
interpreter: "none"
|
||||
},
|
||||
|
||||
{
|
||||
name: "mqtt-gateway",
|
||||
script: "app.js",
|
||||
cwd: "/root/xiaozhi-esp32-server/main/mqtt-gateway",
|
||||
interpreter: "node",
|
||||
watch: true
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
|
|
@ -38,6 +38,7 @@ public class RenExceptionHandler {
|
|||
|
||||
@ExceptionHandler(DuplicateKeyException.class)
|
||||
public Result<Void> handleDuplicateKeyException(DuplicateKeyException ex) {
|
||||
log.error("Duplicate key error: {}", ex.getMessage(), ex);
|
||||
Result<Void> result = new Result<>();
|
||||
result.error(ErrorCode.DB_RECORD_EXISTS);
|
||||
|
||||
|
|
@ -81,4 +82,4 @@ public class RenExceptionHandler {
|
|||
return new Result<Void>().error(ErrorCode.PARAM_VALUE_NULL, errorMsg);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,10 +7,6 @@ knife4j:
|
|||
password: 2ZABCDEUgF
|
||||
setting:
|
||||
enableFooter: false
|
||||
|
||||
# Server configuration
|
||||
server:
|
||||
secret: d153e93c-bb2f-42e7-8045-a1ee47a1dcfc
|
||||
spring:
|
||||
datasource:
|
||||
druid:
|
||||
|
|
@ -22,9 +18,9 @@ spring:
|
|||
# password: cTefiuLmZSMqGpcQImUmBIsUBhNyUvrK
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# Railway MySQL Configuration - Updated for Railway database
|
||||
url: jdbc:mysql://crossover.proxy.rlwy.net:56145/railway?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&useSSL=true&allowPublicKeyRetrieval=true
|
||||
url: jdbc:mysql://nozomi.proxy.rlwy.net:25037/railway?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&useSSL=true&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: XjOWQwtGNcoMIELTjoMoaaBTfKiBjVcA
|
||||
password: OcaVNLKcwNdyElfaeUPqvvfYZiiEHgdm
|
||||
|
||||
initial-size: 10
|
||||
max-active: 100
|
||||
|
|
@ -50,9 +46,9 @@ spring:
|
|||
data:
|
||||
redis:
|
||||
# Railway Redis Configuration
|
||||
host: yamanote.proxy.rlwy.net # Railway Redis服务器地址
|
||||
port: 34938 # Railway Redis服务器连接端口
|
||||
password: YbdhwguVUNowduNpDZjuSefZFhBXiOEP # Railway Redis服务器连接密码
|
||||
host: maglev.proxy.rlwy.net # Railway Redis服务器地址
|
||||
port: 16780 # Railway Redis服务器连接端口
|
||||
password: beVfOKcZjMUCBiZIQnvSMivhpSeijpKP # Railway Redis服务器连接密码
|
||||
username: default # Railway Redis用户名
|
||||
database: 0 # Redis数据库索引(默认为0)
|
||||
timeout: 30000ms # 连接超时时间(毫秒)- 增加超时时间
|
||||
|
|
@ -63,4 +59,4 @@ spring:
|
|||
max-active: 8 # 连接池最大连接数(使用负值表示没有限制)
|
||||
max-idle: 8 # 连接池中的最大空闲连接
|
||||
min-idle: 0 # 连接池中的最小空闲连接
|
||||
shutdown-timeout: 100ms # 客户端优雅关闭的等待时间
|
||||
shutdown-timeout: 100ms # 客户端优雅关闭的等待时间
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"production": {
|
||||
"chat_servers": [
|
||||
"ws://64.227.170.31:8000/toy/v1/"
|
||||
"ws://139.59.7.72:8000/toy/v1/"
|
||||
]
|
||||
},
|
||||
"development": {
|
||||
"chat_servers": [
|
||||
"ws://64.227.170.31:8000/toy/v1/"
|
||||
"ws://139.59.7.72:8000/toy/v1/"
|
||||
],
|
||||
"mac_addresss": [
|
||||
]
|
||||
|
|
|
|||
BIN
main/xiaozhi-server/cache/cdn_audio/c203ba160fae43fdfeac6fa96235e389.mp3
vendored
Normal file
BIN
main/xiaozhi-server/cache/cdn_audio/c203ba160fae43fdfeac6fa96235e389.mp3
vendored
Normal file
Binary file not shown.
BIN
main/xiaozhi-server/cache/cdn_audio/f8710a9e72437540f8210c893d646cac.mp3
vendored
Normal file
BIN
main/xiaozhi-server/cache/cdn_audio/f8710a9e72437540f8210c893d646cac.mp3
vendored
Normal file
Binary file not shown.
Loading…
Reference in a new issue