diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 18db34bd..7aca3130 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -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 && \ diff --git a/internal/cron/cron.go b/internal/cron/cron.go index ede41678..630bc0ae 100644 --- a/internal/cron/cron.go +++ b/internal/cron/cron.go @@ -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)