diff --git a/r2s-bwmsgsv2.rb b/r2s-bwmsgsv2.rb index a88487e9e95b7d778e788b50be1fde5b0ed5265e..20649a46894deeb8994da3f5632320cf4aeb5f51 100755 --- a/r2s-bwmsgsv2.rb +++ b/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" %