Skip to content

Commit

Permalink
autopep8 action fixes (#391)
Browse files Browse the repository at this point in the history
Co-authored-by: mattldawson <mattldawson@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and mattldawson committed May 15, 2024
1 parent 2f944f5 commit 9446b83
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
14 changes: 10 additions & 4 deletions interactive/rabbit_mq_model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
logging.getLogger("pika").propagate = False

# updates the status of the model run in the database


def set_model_run_status(session_id, status, error=None, output=None):
model_run = get_model_run(session_id)
model_run.status = status
Expand Down Expand Up @@ -72,14 +74,18 @@ def music_box_exited_callback(session_id, output_directory):
# read error file
with open(error_path, "r") as f:
set_model_run_status(
session_id, RunStatus.ERROR.value, error=f.read(), output=output_data
)
session_id,
RunStatus.ERROR.value,
error=f.read(),
output=output_data)
elif os.path.exists(warning_path):
# read warning file
with open(warning_path, "r") as f:
set_model_run_status(
session_id, RunStatus.ERROR.value, error=f.read(), output=output_data
)
session_id,
RunStatus.ERROR.value,
error=f.read(),
output=output_data)
else:
set_model_run_status(
session_id,
Expand Down
3 changes: 2 additions & 1 deletion interactive/shared/rabbit_mq.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def consume(consumer_configs, rabbit_config=RabbitConfig()):
for key in consumer.route_keys:
result = channel.queue_declare(queue=key)
queue_name = result.method.queue
logger.info(f"Binding {key} to {queue_name} on {rabbit_config.exchange}")
logger.info(
f"Binding {key} to {queue_name} on {rabbit_config.exchange}")
channel.queue_bind(
exchange=rabbit_config.exchange,
queue=queue_name,
Expand Down

0 comments on commit 9446b83

Please sign in to comment.