mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-01-15 11:17:49 +08:00
no log: deal with potential exception with missing time zone info.
This commit is contained in:
parent
27f4c41a0e
commit
4640badd4b
1 changed files with 8 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
import os
|
||||
import platform
|
||||
import logging
|
||||
|
||||
from flask import jsonify
|
||||
from flask_restful import Resource
|
||||
|
@ -24,6 +25,12 @@ class SystemStatus(Resource):
|
|||
if 'BAZARR_PACKAGE_AUTHOR' in os.environ and os.environ['BAZARR_PACKAGE_AUTHOR'] != '':
|
||||
package_version = f'{package_version} by {os.environ["BAZARR_PACKAGE_AUTHOR"]}'
|
||||
|
||||
try:
|
||||
timezone = get_localzone_name() or "Undefined"
|
||||
except Exception:
|
||||
timezone = "Exception while getting time zone name."
|
||||
logging.exception("BAZARR is unable to get configured time zone name.")
|
||||
|
||||
system_status = {}
|
||||
system_status.update({'bazarr_version': os.environ["BAZARR_VERSION"]})
|
||||
system_status.update({'package_version': package_version})
|
||||
|
@ -35,6 +42,6 @@ class SystemStatus(Resource):
|
|||
os.path.dirname(__file__))))})
|
||||
system_status.update({'bazarr_config_directory': args.config_dir})
|
||||
system_status.update({'start_time': startTime})
|
||||
system_status.update({'timezone': get_localzone_name() or 'Undefined'})
|
||||
system_status.update({'timezone': timezone})
|
||||
|
||||
return jsonify(data=system_status)
|
||||
|
|
Loading…
Reference in a new issue