Преглед на файлове

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

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
yihong преди 4 месеца
родител
ревизия
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: