diff --git a/sgx_jmp.rb b/sgx_jmp.rb index 20f054375937e2c32eadca4e4e7f55aa7322d00a..8347b0784975d5d19d8f2d877dda9230bd490cbe 100644 --- a/sgx_jmp.rb +++ b/sgx_jmp.rb @@ -274,10 +274,10 @@ message do |m| customer.stanza_from(m) ]).then { customer } }.then { |customer| - ExpiringLock.new("jmp_usage_notify-#{customer.customer_id}").with do - customer.message_usage((today..(today - 30))).then do |usage| - next unless usage > 500 + customer.message_usage((today..(today - 30))).then do |usage| + next unless usage > 500 + ExpiringLock.new("jmp_usage_notify-#{customer.customer_id}").with do BLATHER.join(CONFIG[:notify_admin], "sgx-jmp") BLATHER.say( CONFIG[:notify_admin],