app/controllers/extface/handler_controller.rb in extface-0.1.8 vs app/controllers/extface/handler_controller.rb in extface-0.1.9
- old
+ new
@@ -19,11 +19,11 @@
p e.message
render nothing: true, status: :internal_server_error
ensure
response.stream.close
end
-
+
def push
# get request.body.read
# if it is push message, process it
status = :not_implemented
unless device.present?
@@ -33,13 +33,13 @@
r.append device.uuid, request.body.read
@full_buffer = r.get device.uuid
end
if bytes_porcessed = device.driver.handle(@full_buffer.b)
Extface.redis_block do |r|
- r.set device.uuid, r.get(device.uuid)[bytes_porcessed]
+ r.set device.uuid, @full_buffer.b[bytes_porcessed..-1]
end
end
- stream_job # stream right now :)
+ #stream_job # stream right now :)
status = :ok
end
rescue => e
p e.message
render nothing: true, status: :internal_server_error