瀏覽代碼

fix: utcfromtimestamp is Deprecated change to new api (#12120)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
yihong 3 月之前
父節點
當前提交
3d150c30a7
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      api/extensions/ext_logging.py

+ 1 - 1
api/extensions/ext_logging.py

@@ -46,7 +46,7 @@ def init_app(app: DifyApp):
         timezone = pytz.timezone(log_tz)
 
         def time_converter(seconds):
-            return datetime.utcfromtimestamp(seconds).astimezone(timezone).timetuple()
+            return datetime.fromtimestamp(seconds, tz=timezone).timetuple()
 
         for handler in logging.root.handlers:
             if handler.formatter: