Fix farmware bug #616

pull/618/head
connor rigby 2018-08-10 12:21:28 -07:00
parent 4b042c9f76
commit 5e9160ae32
No known key found for this signature in database
GPG Key ID: 24DC438382965C3B
2 changed files with 15 additions and 2 deletions

View File

@ -1,6 +1,7 @@
# Changelog
# 6.4.9
* Add feature to save logs to sdcard for debugging.
* Fix bug causing long running Farmwares to fail.
* Update Linux system layer.
# 6.4.8

View File

@ -57,8 +57,20 @@ defmodule Farmbot.BotState.Transport.HTTP do
public_key = body |> JOSE.JWK.from_pem
# FIXME(Connor) The router should probably
# be put in an externally supervised module..
opts = [port: @port, acceptors: 2, dispatch: [cowboy_dispatch()]]
case Plug.Adapters.Cowboy2.http Router, [], opts do
protocol_options = [
idle_timeout: :infinity,
shutdown_timeout: :infinity,
inactivity_timeout: :infinity,
shutdown_timeout: :infinity,
request_timeout: :infinity
]
opts = [
port: @port,
acceptors: 2,
dispatch: [cowboy_dispatch()],
protocol_options: protocol_options
]
case Plug.Adapters.Cowboy2.http(Router, [], opts) do
{:ok, web} ->
state = %{web: web, bot_state: nil, sockets: [], public_key: public_key}
Process.link(state.web)