makerspace / memberbooth

Displaying member info on a public machine
2 stars 0 forks source link

Network requests need a timeout #82

Closed emanuelen5 closed 4 years ago

emanuelen5 commented 4 years ago

https://github.com/makerspace/memberbooth/blob/56bfa79e975b813b7ce37eeedc140c0c739231f6/src/backend/makeradmin.py#L31

See https://requests.readthedocs.io/en/master/user/quickstart/ for an explanation.

emanuelen5 commented 4 years ago

The solution is to just add timeout=0.5 to the request. See https://requests.readthedocs.io/en/master/api/#main-interface.

InMyOrbit commented 4 years ago

Suggestion to solution in 6b0f34d80256eb934a294de4d0ae46c8fe806c32, @emanuelen5 can you try it, I am still not great with the backend-part :-).

Suggested ways of injecting the problem can be found here: https://stackoverflow.com/questions/100841/artificially-create-a-connection-timeout-error

emanuelen5 commented 4 years ago

I'd say that we need to create some unit tests to be able to check this thoroughly.