Skip to content
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

Merged
merged 6 commits into from
Aug 17, 2016

Conversation

YonderGod
Copy link

DISABLE_MARKERS = []
in config

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]
Copy link
Owner

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).

Copy link
Author

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.

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?

@modrzew
Copy link
Owner

modrzew commented Aug 17, 2016

Thanks!

@modrzew modrzew merged commit 15a5aa6 into modrzew:master Aug 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants