mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-10 18:05:48 +02:00
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
This commit is contained in:
parent
a00a4f19d2
commit
03b02010ed
2 changed files with 2 additions and 2 deletions
|
@ -2,7 +2,7 @@ FROM mcr.microsoft.com/devcontainers/base:jammy
|
|||
|
||||
# Combine installation steps for Nginx and Go to avoid repetitive update/cleanup commands
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends curl gnupg2 ca-certificates lsb-release ubuntu-keyring jq && \
|
||||
apt-get install -y --no-install-recommends curl gnupg2 ca-certificates lsb-release ubuntu-keyring jq cloc && \
|
||||
\
|
||||
# Configure the Nginx repository
|
||||
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor > /usr/share/keyrings/nginx-archive-keyring.gpg && \
|
||||
|
|
|
@ -70,7 +70,7 @@ func cleanExpiredAuthToken() {
|
|||
logger.Debug("clean expired auth tokens")
|
||||
q := query.AuthToken
|
||||
_, _ = q.Where(q.ExpiredAt.Lt(time.Now().Unix())).Delete()
|
||||
}), gocron.WithSingletonMode(gocron.LimitModeWait))
|
||||
}), gocron.WithSingletonMode(gocron.LimitModeWait), gocron.JobOption(gocron.WithStartImmediately()))
|
||||
|
||||
if err != nil {
|
||||
logger.Fatalf("CleanExpiredAuthToken Err: %v\n", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue