From a1d8a00238fb58957aec9cc110dba659d2e960e1 Mon Sep 17 00:00:00 2001 From: wangfuduo Date: Sat, 31 Oct 2026 14:29:55 +0800 Subject: [PATCH] fix: start.sh --- conf/server.conf.prod | 10 +++++----- start.sh | 19 +++++++++++++++---- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/conf/server.conf.prod b/conf/server.conf.prod index 31c1be9..de08df0 100644 --- a/conf/server.conf.prod +++ b/conf/server.conf.prod @@ -10,15 +10,15 @@ app_domain = "https://twin.batiao8.com" ingore_event = "/api/user/event" [mysql] -host = "10.0.2.157" -port = 3307 +host = "10.7.0.36" +port = 3308 user = "twin" pass = "z[T)5svx--N(nUO(" db = "twin" threshold = 10000 [elastic] -address = "http://10.0.2.133:9200" +address = "http://10.7.0.36:9200" username = "elastic" password = "o2NJzeAODwpfAgLJ5SFY" @@ -48,7 +48,7 @@ qy_kf_id = "" [metric] -address = "http://10.0.2.157:8086" +address = "http://10.7.0.36:8086" username = "batiao" password = "Batiao12B" @@ -66,4 +66,4 @@ qiniu_secret_key = "C2fUI3qdrQIPkwx2yB4h1Etjbb0LQ15P4aHwShWa" minio_domain = "https://m.batiao8.com" minio_bucket = "member" minio_access_key = "minio" -minio_secret_key = "Minio@Bat123" \ No newline at end of file +minio_secret_key = "Minio@Bat123" diff --git a/start.sh b/start.sh index 1ac301d..c59d3c0 100644 --- a/start.sh +++ b/start.sh @@ -1,5 +1,18 @@ #!/bin/bash -set -x + +crash() { + SERVICE_NAME="$_SERVICE_NAME" + HOSTNAME_="${_POD_NAME:-$(hostname)}" + IP="$_POD_IP" + curl -sS -G "https://t.batiao8.com/ext/service/crash" \ + --connect-timeout 3 --max-time 5 \ + --retry 2 --retry-delay 1 \ + --data-urlencode "service=$SERVICE_NAME" \ + --data-urlencode "hostname=$HOSTNAME_" \ + --data-urlencode "ip=$IP" \ + >/dev/null 2>&1 || true +} + ROOT=$(cd `dirname $0`; pwd) cd $ROOT @@ -9,8 +22,6 @@ fi while [ true ];do $ROOT/bin/$BINARY $@ >> log/run.log 2>&1 - /usr/local/bin/sendproxy weixin "jiangyong,ranzhenghua" "[$HOSTNAME] [$CONFIG_ENV] [$BINARY] 服务崩溃[`date +"%Y-%m-%d %H:%M:%S"`]" + crash sleep 10 done - -