Skip to content

Commit

Permalink
Include the LVM Web link in a Slack message when the fill starts
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Nov 11, 2024
1 parent 36d0b2f commit ea9f2ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Next version

### ✨ Improved

* Include the LVM Web link in a Slack message when the fill starts.

### 🔧 Fixed

* Fix rendering of Grafana URL in Slack message.
Expand Down
9 changes: 8 additions & 1 deletion src/lvmcryo/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,14 @@ async def ln2_runner(
action = config.action.value

if config.use_thermistors or config.purge_time is None or config.fill_time is None:
await notifier.post_to_slack(f"Starting LN₂ `{action}` at {now_str}.")
lvmweb_url = config.internal_config["notifications.lvmweb_fill_url"]
message = f"Starting LN₂ `{action}` at {now_str}."
if db_handler and db_handler.pk is not None:
fill_url = lvmweb_url.format(fill_id=db_handler.pk)
message += f" Details can be followed from the <{fill_url}|LVM webapp>."

await notifier.post_to_slack(message)

else:
await notifier.post_to_slack(
f"Starting LN₂ `{action}` at {now_str} with "
Expand Down

0 comments on commit ea9f2ce

Please sign in to comment.