Skip to content

Commit 03b0201

Browse files
committed
chore: enhance devcontainer and cron job configuration
- Add cloc to devcontainer Dockerfile for code line counting - Modify cron job to start cleaning expired auth tokens immediately
1 parent a00a4f1 commit 03b0201

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.devcontainer/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM mcr.microsoft.com/devcontainers/base:jammy
22

33
# Combine installation steps for Nginx and Go to avoid repetitive update/cleanup commands
44
RUN apt-get update && \
5-
apt-get install -y --no-install-recommends curl gnupg2 ca-certificates lsb-release ubuntu-keyring jq && \
5+
apt-get install -y --no-install-recommends curl gnupg2 ca-certificates lsb-release ubuntu-keyring jq cloc && \
66
\
77
# Configure the Nginx repository
88
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor > /usr/share/keyrings/nginx-archive-keyring.gpg && \

internal/cron/cron.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func cleanExpiredAuthToken() {
7070
logger.Debug("clean expired auth tokens")
7171
q := query.AuthToken
7272
_, _ = q.Where(q.ExpiredAt.Lt(time.Now().Unix())).Delete()
73-
}), gocron.WithSingletonMode(gocron.LimitModeWait))
73+
}), gocron.WithSingletonMode(gocron.LimitModeWait), gocron.JobOption(gocron.WithStartImmediately()))
7474

7575
if err != nil {
7676
logger.Fatalf("CleanExpiredAuthToken Err: %v\n", err)

0 commit comments

Comments
 (0)