update log string, add todo, remove 'json' require

Denver Gingerich created

Updated a log message to remove TODO as we won't be putting the ID of
the message in the log, for privacy reasons.  This also means that we
won't have any need to read JSON anymore, so we can delete that
"require 'json'" line as well.

Added a TODO about handling another return value (of INCR).  This
probably isn't a big deal either way, as an INCR returning an error
multiple times will result in duplicate archived_message keys that
will be caught elsewhere, but there is still a small chance it won't
be caught, so it would be good to fix eventually.

Change summary

r2s-bwmsgsv2.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Detailed changes

r2s-bwmsgsv2.rb 🔗

@@ -20,7 +20,6 @@
 require 'redis'
 require 'hiredis'
 require 'net/http'
-require 'json'
 require 'time'
 
 $stdout.sync = true
@@ -61,13 +60,14 @@ while true
 	t = Time.now
 	tai_timestamp = `./tai`.strip
 	tai_yyyymmdd = Time.at(tai_timestamp.to_i).strftime('%Y%m%d')
-	puts "LOG %d.%09d, %s: msg [TODO: ID] sent on %s - incrementing\n" %
+	puts "LOG %d.%09d, %s: handling message sent on %s ...\n" %
 		[t.to_i, t.nsec, tai_timestamp, tai_yyyymmdd]
 
 	# WARNING: since not atomic with setex() below, translator is singleton
 	day_msg_count = redis.incr(
 		"archived_message-#{ARGV[0]}-#{tai_yyyymmdd}-total"
 	)
+	# TODO: confirm day_msg_count is integer > 0 (otherwise likely an error)
 
 	t = Time.now
 	puts "LOG %d.%09d: total msgs for %s-%s now at %s\n" %