Skip to content

Commit

Permalink
Use keywords in AlphaSms balance check logs for easy filtering (#5374)
Browse files Browse the repository at this point in the history
**Story card:**
[sc-11640](https://app.shortcut.com/simpledotorg/story/11640/automate-alphasms-balance-check)

Use "AlphaSms account balance" in account balance check logs to be able
to filter these more intentionally.
  • Loading branch information
qptr authored Jan 4, 2024
1 parent c7ad1a7 commit 3b5f09a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/tasks/alpha_sms.rake
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ namespace :alpha_sms do
balance_amount = response.dig(:data, :balance)&.to_f

if expiry_date < alert_in_days.days.from_now
Rails.logger.error("Account balance expires in less than #{alert_in_days}. Please recharge before #{expiry_date}.")
Rails.logger.error("AlphaSms account balance expires in less than #{alert_in_days}. Please recharge before #{expiry_date}.")
elsif balance_amount < (alert_in_days * max_cost_per_day)
Rails.logger.error("Remaining account balance is #{balance_amount} BDT. May expire in less than #{alert_in_days} days.")
Rails.logger.error("Alphasms account balance remaining is #{balance_amount} BDT. May expire in less than #{alert_in_days} days.")
end
print("Balance: #{balance_amount} BDT\nExpiry: #{expiry_date}")
end
Expand Down

0 comments on commit 3b5f09a

Please sign in to comment.