Check for going over 500 every time

Stephen Paul Weber created

Don't fill redis with keys for users who did not go over

Change summary

sgx_jmp.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Detailed changes

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],