fix for the duplicate key error. The changes prevent duplicate plugin mappings from being inserted when creating new agents.

This commit is contained in:
rahulpscraftech360 2025-09-06 13:39:11 +05:30
parent 43f111af9a
commit fc526d12f0
6 changed files with 37 additions and 13 deletions

27
ecosystem.config.js Normal file
View 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
}
]
};

View file

@ -38,6 +38,7 @@ public class RenExceptionHandler {
@ExceptionHandler(DuplicateKeyException.class) @ExceptionHandler(DuplicateKeyException.class)
public Result<Void> handleDuplicateKeyException(DuplicateKeyException ex) { public Result<Void> handleDuplicateKeyException(DuplicateKeyException ex) {
log.error("Duplicate key error: {}", ex.getMessage(), ex);
Result<Void> result = new Result<>(); Result<Void> result = new Result<>();
result.error(ErrorCode.DB_RECORD_EXISTS); result.error(ErrorCode.DB_RECORD_EXISTS);
@ -81,4 +82,4 @@ public class RenExceptionHandler {
return new Result<Void>().error(ErrorCode.PARAM_VALUE_NULL, errorMsg); return new Result<Void>().error(ErrorCode.PARAM_VALUE_NULL, errorMsg);
} }
} }

View file

@ -7,10 +7,6 @@ knife4j:
password: 2ZABCDEUgF password: 2ZABCDEUgF
setting: setting:
enableFooter: false enableFooter: false
# Server configuration
server:
secret: d153e93c-bb2f-42e7-8045-a1ee47a1dcfc
spring: spring:
datasource: datasource:
druid: druid:
@ -22,9 +18,9 @@ spring:
# password: cTefiuLmZSMqGpcQImUmBIsUBhNyUvrK # password: cTefiuLmZSMqGpcQImUmBIsUBhNyUvrK
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
# Railway MySQL Configuration - Updated for Railway database # 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 username: root
password: XjOWQwtGNcoMIELTjoMoaaBTfKiBjVcA password: OcaVNLKcwNdyElfaeUPqvvfYZiiEHgdm
initial-size: 10 initial-size: 10
max-active: 100 max-active: 100
@ -50,9 +46,9 @@ spring:
data: data:
redis: redis:
# Railway Redis Configuration # Railway Redis Configuration
host: yamanote.proxy.rlwy.net # Railway Redis服务器地址 host: maglev.proxy.rlwy.net # Railway Redis服务器地址
port: 34938 # Railway Redis服务器连接端口 port: 16780 # Railway Redis服务器连接端口
password: YbdhwguVUNowduNpDZjuSefZFhBXiOEP # Railway Redis服务器连接密码 password: beVfOKcZjMUCBiZIQnvSMivhpSeijpKP # Railway Redis服务器连接密码
username: default # Railway Redis用户名 username: default # Railway Redis用户名
database: 0 # Redis数据库索引(默认为0) database: 0 # Redis数据库索引(默认为0)
timeout: 30000ms # 连接超时时间(毫秒)- 增加超时时间 timeout: 30000ms # 连接超时时间(毫秒)- 增加超时时间
@ -63,4 +59,4 @@ spring:
max-active: 8 # 连接池最大连接数(使用负值表示没有限制) max-active: 8 # 连接池最大连接数(使用负值表示没有限制)
max-idle: 8 # 连接池中的最大空闲连接 max-idle: 8 # 连接池中的最大空闲连接
min-idle: 0 # 连接池中的最小空闲连接 min-idle: 0 # 连接池中的最小空闲连接
shutdown-timeout: 100ms # 客户端优雅关闭的等待时间 shutdown-timeout: 100ms # 客户端优雅关闭的等待时间

View file

@ -1,12 +1,12 @@
{ {
"production": { "production": {
"chat_servers": [ "chat_servers": [
"ws://64.227.170.31:8000/toy/v1/" "ws://139.59.7.72:8000/toy/v1/"
] ]
}, },
"development": { "development": {
"chat_servers": [ "chat_servers": [
"ws://64.227.170.31:8000/toy/v1/" "ws://139.59.7.72:8000/toy/v1/"
], ],
"mac_addresss": [ "mac_addresss": [
] ]