From 39000e3237c65bdc022426e583369439a403272c Mon Sep 17 00:00:00 2001 From: Giordon Stark Date: Mon, 23 Jun 2025 09:04:30 -0700 Subject: [PATCH] disable notifications --- viewer/functions/commandline.py | 9 +++++++++ viewer/functions/common.py | 2 ++ 2 files changed, 11 insertions(+) diff --git a/viewer/functions/commandline.py b/viewer/functions/commandline.py index c9a33355d..f426ea359 100755 --- a/viewer/functions/commandline.py +++ b/viewer/functions/commandline.py @@ -83,6 +83,11 @@ def getArgs(): help="Secret key that is used throughout the app for all encrypted items (CSRF, sessions, JWT tokens, etc.). Will randomly generate by default.", type=str, ) + parser.add_argument( + "--disable-notifications", + help="Disable live notifications", + action="store_true", + ) args = parser.parse_args() @@ -161,6 +166,8 @@ def getArgs(): args.prefix = conf["flask"]["prefix"] if "secret_key" in conf["flask"] and not args.secret_key: args.secret_key = conf["flask"]["secret_key"] + if "notifications" in conf["flask"] and not args.disable_notifications: + args.disable_notifications = conf["flask"]["notifications"] if "userDB" in conf and "db" in conf.get("userDB", {}) and not args.userdb: args.userdb = conf["userDB"]["db"] @@ -192,5 +199,7 @@ def getArgs(): args.prefix = "localdb" if not args.secret_key: args.secret_key = os.urandom(24) + if not args.disable_notifications: + args.disable_notifications = False return args diff --git a/viewer/functions/common.py b/viewer/functions/common.py index 4dbd22175..8519ca3b0 100755 --- a/viewer/functions/common.py +++ b/viewer/functions/common.py @@ -898,6 +898,8 @@ def dt_tz_to_timestamp(dt, *, tzinfo=None): def emit_message(message, title, level="info", timestamp=None): + if args.disable_notifications: + return timestamp = timestamp or arrow.now("local") socketio.emit( -- GitLab