Skip to content

Commit 37778f9

Browse files
committed
Use PikaTransport object directly to load RabbitMQ credentials
1 parent 46ad843 commit 37778f9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/murfey/server/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import mrcfile
1818
import numpy as np
1919
import uvicorn
20-
import workflows
2120
from backports.entry_points_selectable import entry_points
2221
from fastapi import Request
2322
from fastapi.templating import Jinja2Templates
@@ -42,6 +41,7 @@
4241
from sqlalchemy.orm.exc import ObjectDeletedError
4342
from sqlmodel import Session, create_engine, select
4443
from werkzeug.utils import secure_filename
44+
from workflows.transport.pika_transport import PikaTransport
4545

4646
import murfey
4747
import murfey.server.ispyb
@@ -273,6 +273,7 @@ def run():
273273
help="Increase logging output verbosity",
274274
default=0,
275275
)
276+
args = parser.parse_args()
276277

277278
security_config = get_security_config()
278279
# setup logging
@@ -286,15 +287,14 @@ def run():
286287
# Install a log filter to all existing handlers.
287288
LogFilter.install()
288289

289-
workflows.transport.load_configuration_file(security_config.rabbitmq_credentials)
290-
291-
args = parser.parse_args()
290+
# Load RabbitMQ configuration
291+
PikaTransport().load_configuration_file(security_config.rabbitmq_credentials)
292292

293293
# Set up Zocalo connection
294294
if args.demo:
295295
os.environ["MURFEY_DEMO"] = "1"
296296
else:
297-
_set_up_transport(args.transport)
297+
_set_up_transport("pika")
298298

299299
# Set up logging now that the desired verbosity is known
300300
_set_up_logging(quiet=args.quiet, verbosity=args.verbose)

0 commit comments

Comments
 (0)