diff --git a/pyproject.toml b/pyproject.toml index e3ac0eb87..40a6508ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -80,8 +80,8 @@ Bug-Tracker = "https://github.com/DiamondLightSource/python-murfey/issues" Documentation = "https://github.com/DiamondLightSource/python-murfey" GitHub = "https://github.com/DiamondLightSource/python-murfey" [project.scripts] -murfey = "murfey.client:run" "murfey.add_user" = "murfey.cli.add_user:run" +"murfey.client" = "murfey.client:run" "murfey.create_db" = "murfey.cli.create_db:run" "murfey.db_sql" = "murfey.cli.murfey_db_sql:run" "murfey.decrypt_password" = "murfey.cli.decrypt_db_password:run" diff --git a/src/murfey/instrument_server/__init__.py b/src/murfey/instrument_server/__init__.py index be0fc49fc..e6316a41a 100644 --- a/src/murfey/instrument_server/__init__.py +++ b/src/murfey/instrument_server/__init__.py @@ -1,10 +1,12 @@ import argparse import logging +from urllib.parse import urlparse import uvicorn from rich.logging import RichHandler import murfey +import murfey.client.update from murfey.client.customlogging import CustomHandler from murfey.util import LogFilter from murfey.util.client import read_config @@ -27,6 +29,12 @@ def run(): ) args = parser.parse_args() + murfey_url = urlparse(read_config()["Murfey"].get("server"), allow_fragments=False) + try: + murfey.client.update.check(murfey_url) + except Exception as e: + print(f"Murfey update check failed with {e}") + LogFilter.install() rich_handler = RichHandler(enable_link_path=False)