Explorar el Código

fix(api): patch Windows timezone set (#1575)

Rhon Joe hace 1 año
padre
commit
7cda3fe85b
Se han modificado 1 ficheros con 6 adiciones y 2 borrados
  1. 6 2
      api/app.py

+ 6 - 2
api/app.py

@@ -37,8 +37,12 @@ from libs.passport import PassportService
 import warnings
 warnings.simplefilter("ignore", ResourceWarning)
 
-os.environ['TZ'] = 'UTC'
-time.tzset()
+# fix windows platform
+if os.name == "nt":
+    os.system('tzutil /s "UTC"')    
+else:
+    os.environ['TZ'] = 'UTC'
+    time.tzset()
 
 
 class DifyApp(Flask):