Skip to content

Commit

Permalink
Warn if size is null (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
iskakaushik authored Dec 18, 2023
1 parent 5e8773c commit fe53be9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ def main(
post_message_to_slack(slack_channel, f"🔥 [{deployment_name}] Error querying replication slots: {e}")
continue
for slot_name, size in slots:
if size is None:
post_message_to_slack(slack_channel, f"⚠️ [{deployment_name}] Replication slot '{slot_name}' size is NULL.")
continue
size_mb = size / 1024 / 1024
if size_mb > size_threshold_mb:
msg = f"☠️ [{deployment_name}] Replication slot '{slot_name}' size is over {size_threshold_mb}MiB: {size_mb:.2f}MiB. cc: @channel"
Expand Down

0 comments on commit fe53be9

Please sign in to comment.