slack_notifications uses the process name from sys.argv in notifications.
|
process = os.path.basename(sys.argv[0]) |
|
try: |
|
yield |
|
|
|
slack_client = SlackClient(token) |
|
slack_client.send_message( |
|
to, f":white_check_mark: Success! {process} finished!" |
|
) |
|
except Exception as e: |
|
slack_client = SlackClient(token) |
|
slack_client.send_file( |
|
to, |
|
content=traceback.format_exc(), |
|
filename=f"error_{process}_{time.strftime('%Y-%m-%d_%H:%M')}.log", |
|
filetype="text", |
|
comment=f":x: Error in {process}", |
|
) |
However, someone may want notifications about multiple blocks in the same script. There should be a way to distinguish those notifications.
slack_notificationsuses the process name fromsys.argvin notifications.gnomad_methods/gnomad/utils/slack.py
Lines 156 to 172 in 0b8e100
However, someone may want notifications about multiple blocks in the same script. There should be a way to distinguish those notifications.