Merge Daemon features into master#1
Open
Snapple49 wants to merge 15 commits into
Open
Conversation
benblamey
reviewed
Apr 4, 2018
| af, socktype, proto, canonname, sa = res | ||
| try: | ||
| listening_socket = socket.socket(af, socktype, proto) | ||
| listening_socket.settimeout(Setting.get_idle_timeout()) # set the socket timeout to specified value from Settings, if not specified acts as if nothing changed |
Member
There was a problem hiding this comment.
add comment?
(this is reliant on use of 'blocking' socket.listen below)
Member
There was a problem hiding this comment.
better to wrap this inside an 'if not none:' - more robust that way (incase the socket API changes in the future, etc.)
Author
There was a problem hiding this comment.
True, that is safer if they ever change those things, didn't think it's likely but better safe than sorry. Fixed!
benblamey
reviewed
Apr 4, 2018
| restarted = False | ||
| except socket.timeout as t: | ||
| # graceful container exit - notify master I am quitting | ||
| import requests, os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added some features about timeout, exiting when container does not get any requests within specified timeout period and requesting from master permission to self terminate, freeing up system resources