chore: update and move to the new server
This commit is contained in:
@@ -8,7 +8,7 @@ jobs:
|
||||
build:
|
||||
runs-on: gitea-runner-group-blog
|
||||
container:
|
||||
image: harbor.merlin.xin/release/merlin/action_builder:v0.0.1
|
||||
image: ${{ vars.HARBOR_URL }}/candlelight/action_builder:v0.0.1
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
@@ -8,7 +8,7 @@ jobs:
|
||||
build:
|
||||
runs-on: gitea-runner-group-blog
|
||||
container:
|
||||
image: harbor.merlin.xin/release/merlin/action_builder:v0.0.1
|
||||
image: ${{ vars.HARBOR_URL }}/candlelight/action_builder:v0.0.1
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
REPOSITORY: ${{ github.repository }}
|
||||
run: |
|
||||
ROOT_DIR=$(pwd)
|
||||
IMAGE_NAME="${HARBOR_URL}/release/$REPOSITORY:$GITHUB_REF_NAME"
|
||||
IMAGE_NAME="${HARBOR_URL}/$REPOSITORY:$GITHUB_REF_NAME"
|
||||
echo "Building image: ${IMAGE_NAME}"
|
||||
docker build -t ${IMAGE_NAME} .
|
||||
echo "Pushing image: ${IMAGE_NAME}"
|
||||
|
||||
@@ -3,7 +3,9 @@ package xin.merlin.myblog_server.utils;
|
||||
import io.jsonwebtoken.*;
|
||||
import io.jsonwebtoken.security.Keys;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import jakarta.annotation.PreDestroy;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import xin.merlin.myblog_server.config.JwtProperties;
|
||||
|
||||
@@ -12,6 +14,8 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class JwtUtil {
|
||||
@@ -34,6 +38,16 @@ public class JwtUtil {
|
||||
}
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
public void destroy() {
|
||||
log.info("JWT 组件正在关闭...");
|
||||
// 如有线程池、定时任务、IO 连接,在这里 shutdown/close
|
||||
// 本例仅把引用置空,帮助 GC(可选)
|
||||
this.jwtParser = null;
|
||||
this.key = null;
|
||||
log.info("JWT 组件已关闭");
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成 JWT Token
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user