Fixed logging delays (missing/misplaced STDOUT.flush calls)

pull/3/head
Aaron Johnson 6 years ago
parent 444795fd9d
commit 3e04c175ce

@ -35,9 +35,11 @@ def process_command_start(message, command, adm)
if message_from_admin?(message, adm)
msg_from_admin = true
end
STDOUT.flush
if is_chat_authorized?(message, @auth_chat)
chat_authorized = true
end
STDOUT.flush
if ! msg_from_admin && ! chat_authorized
if message.from.id == message.chat.id
reply = reply + "\n\nWARNING: I am not authorized to work with you directly. My functionality is limited."
@ -82,6 +84,7 @@ def process_command_check(message, command, adm, simple=false)
puts " Option: #{k} is #{v["loc"].to_s}"
button_text = v["loc"].to_s
options.insert(-1, Telegram::Bot::Types::InlineKeyboardButton.new(text: button_text, callback_data: "ZONE|#{k}"))
STDOUT.flush
end
message_text = "Which area would you like to check?\n"

@ -354,6 +354,7 @@ def handle_message(message)
reply = 'Empty String'
adm = @conf['admin']
puts timestamp + ": Received command from " + "#{message.from.username}".cyan.bold + " [" + "#{message.from.id}".cyan + "]: " + "#{command}".magenta.bold
STDOUT.flush
case command
when '/start', '/help'
process_command_start(message, command, adm)
@ -428,6 +429,7 @@ def handle_exception(e, message, notify_users)
puts "PRINTING BACKTRACE...".yellow.bold
puts e.backtrace
puts "=" * 60
STDOUT.flush
if notify_users == true then
#is this a callback query or a message
case message

@ -3,7 +3,7 @@ Patch Notes:
v1.0.01
+ Added /help as an alias for /start
+ Fixed logging error due to a missing STDOUT.flush
+ Fixed logging errors related to a missing/misplaced STDOUT.flush calls
v1.0.00
+ Initial Release

Loading…
Cancel
Save