Ver Fonte

feat(config): add timezone setting to configuration and update test workflow timezone

Manuel há 9 meses atrás
pai
commit
2cf8a20280
3 ficheiros alterados com 7 adições e 1 exclusões
  1. 1 1
      .github/workflows/test-install.yml
  2. 3 0
      app.py
  3. 3 0
      config.py

+ 1 - 1
.github/workflows/test-install.yml

@@ -12,7 +12,7 @@ jobs:
     runs-on: ubuntu-latest
     env:
       DEBIAN_FRONTEND: noninteractive
-      TZ: UTC
+      TZ: Etc/UTC
 
     strategy:
       matrix:

+ 3 - 0
app.py

@@ -75,6 +75,9 @@ def create_app():
     # Initialize CSRF protection (shared instance with routes)
     csrf.init_app(app)
 
+    # Set timezone for APScheduler before initialization
+    os.environ['TZ'] = Config.TZ
+
     # Initialize extensions
     scheduler = APScheduler()
     scheduler.init_app(app)

+ 3 - 0
config.py

@@ -145,5 +145,8 @@ class Config:
     HTTPS_PROXY = safe_get_env("HTTPS_PROXY", "")
     NO_PROXY = safe_get_env("NO_PROXY", "")
 
+    # Timezone setting
+    TZ = safe_get_env("TZ", "Etc/UTC")
+
     # Squid configuration path
     SQUID_CONFIG_PATH = safe_get_env("SQUID_CONFIG_PATH", "/etc/squid/squid.conf")