Moved work into thread to repsond quickly

This commit is contained in:
2024-08-19 23:21:56 -04:00
parent cf0be2336b
commit ad7417c233

View File

@@ -85,6 +85,7 @@ class QboController < ApplicationController
# proceed if the request is good
if hash.eql? signature
Thread.new do
if request.headers['content-type'] == 'application/json'
data = JSON.parse(data)
else
@@ -123,6 +124,10 @@ class QboController < ApplicationController
# Record that last time we updated
Qbo.update_time_stamp
end
ActiveRecord::Base.connection.close
end
# The webhook doesn't require a response but let's make sure we don't send anything
render :nothing => true, status: 200
else