From ace1e8673b69dab8ca53da635d7b8157011d9ee9 Mon Sep 17 00:00:00 2001 From: hailin Date: Sun, 11 Jan 2026 17:18:25 -0800 Subject: [PATCH] =?UTF-8?q?feat(deploy-mining):=20rebuild=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E5=A2=9E=E5=8A=A0=E6=9C=8D=E5=8A=A1=E9=87=8D=E5=90=AF?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rebuild命令现在会在构建完成后自动停止旧服务并启动新服务, 而不仅仅是编译镜像。 Co-Authored-By: Claude Opus 4.5 --- .../src/api/controllers/contribution.controller.ts | 2 +- backend/services/deploy-mining.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/backend/services/contribution-service/src/api/controllers/contribution.controller.ts b/backend/services/contribution-service/src/api/controllers/contribution.controller.ts index a6dc5831..ba82596d 100644 --- a/backend/services/contribution-service/src/api/controllers/contribution.controller.ts +++ b/backend/services/contribution-service/src/api/controllers/contribution.controller.ts @@ -1,4 +1,4 @@ -import { Controller, Get, Param, Query } from '@nestjs/common'; +import { Controller, Get, Param, Query, NotFoundException } from '@nestjs/common'; import { ApiTags, ApiOperation, ApiResponse, ApiParam } from '@nestjs/swagger'; import { GetContributionAccountQuery } from '../../application/queries/get-contribution-account.query'; import { GetContributionStatsQuery } from '../../application/queries/get-contribution-stats.query'; diff --git a/backend/services/deploy-mining.sh b/backend/services/deploy-mining.sh index 0fbe631a..b443418e 100755 --- a/backend/services/deploy-mining.sh +++ b/backend/services/deploy-mining.sh @@ -386,7 +386,19 @@ service_build() { service_rebuild() { local service="$1" local no_cache="$2" + + # 1. Build the service service_build "$service" "$no_cache" + + # 2. Stop the old service + log_info "Stopping old $service..." + service_stop "$service" + + # 3. Start the new service + log_info "Starting new $service..." + service_start "$service" + + log_success "$service rebuilt and restarted successfully" } # ===========================================================================