~singpolyma/sgx-jmp

39729c2064eb675c73ff9a2137c7baf8b6a4e519 — Stephen Paul Weber 3 years ago b59275f
Check for going over 500 every time

Don't fill redis with keys for users who did not go over
1 files changed, 3 insertions(+), 3 deletions(-)

M sgx_jmp.rb
M sgx_jmp.rb => sgx_jmp.rb +3 -3
@@ 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],