nerves-networking / vintage_net_mobile

Mobile networking for VintageNet
Apache License 2.0
27 stars 11 forks source link

Slow down restarts on tty errors #69

Closed fhunleth closed 4 years ago

fhunleth commented 4 years ago

A tty error comes close in time to the interface going down. Since tty errors end up restarting the ExChat GenServer, there's a flurry of pointless activity that occurs as supervisors do their thing. This slows down the cycle by inserting a sleep. The end result is that when the interface goes down, ExChat is stopped and no spinning on tty errors happens. If, somehow, there is a tty error unrelated to the port going down, retrying after a second seems reasonable.