Skip to content

Commit

Permalink
Timeout should be 15 minutes
Browse files Browse the repository at this point in the history
  • Loading branch information
caiosba committed Oct 27, 2023
1 parent f96329e commit bbbd36d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/bot/smooch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ def self.refresh_smooch_menu_timeout(message, app_id)
uid = message['authorId']
time = Time.now.to_f
Rails.cache.write("smooch:last_message_from_user:#{uid}", time)
self.delay_for(5.minutes, { queue: 'smooch' }).timeout_smooch_menu(time, message, app_id, RequestStore.store[:smooch_bot_provider])
self.delay_for(15.minutes, { queue: 'smooch' }).timeout_smooch_menu(time, message, app_id, RequestStore.store[:smooch_bot_provider])
end

def self.timeout_smooch_menu(time, message, app_id, provider)
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/smooch_search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def send_search_results_to_whatsapp_user(uid, reports, app_id)
}]
self.send_message_to_user_with_buttons(uid, text || '-', options, image_url, 'search_result') # "text" is mandatory for WhatsApp interactive messages
# Schedule each timeout with some interval between them just to avoid race conditions that could create duplicate media
self.delay_for((5 + i).minutes, { queue: 'smooch_priority' }).timeout_if_no_feedback_is_given_to_search_result(app_id, uid, search_id, report.annotated_id)
self.delay_for((15 + i).minutes, { queue: 'smooch_priority' }).timeout_if_no_feedback_is_given_to_search_result(app_id, uid, search_id, report.annotated_id)
end
end

Expand Down

0 comments on commit bbbd36d

Please sign in to comment.