-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to disable certain workers #238
Conversation
Disables worker markers and circles if they are in config.DISABLE_MARKERS
disables workers listed in config.DISABLE_MARKERS
@@ -9,6 +9,7 @@ LANGUAGE = 'EN' # ISO 639-1 codes EN, DE, FR, and ZH currently supported. | |||
MAP_START = (12.3456, 34.5678) | |||
MAP_END = (13.4567, 35.6789) | |||
GRID = (2, 2) # row, column | |||
# DISABLE_MARKERS = [0, 1, 2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For better sounding, please name it DISABLED_WORKERS
. It can also be initialized as an empty list (without # indicating comment).
Please also add it to REQUIRED_SETTINGS
in both worker.py and web.py (at the top).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's like you read my mind. I just noticed not having it in your settings would cause problems, and I was thinking the same about the name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or treat it as an optional config value, and do not require another config update:
if (not hasattr(config, 'DISABLE_MARKERS') or worker_no not in config.DISABLE_MARKERS):
Is it bad approach?
Thanks! |
DISABLE_MARKERS = []
in config