Skip to content

Instantly share code, notes, and snippets.

@CamDavidsonPilon
Created May 10, 2024 12:39
Show Gist options
  • Save CamDavidsonPilon/0a2d1b1ee41372fb29aa6c70c1b1598a to your computer and use it in GitHub Desktop.
Save CamDavidsonPilon/0a2d1b1ee41372fb29aa6c70c1b1598a to your computer and use it in GitHub Desktop.
bg_dodge_fix.py
from pioreactor.background_jobs.base import BackgroundJobWithDodgingContrib
from pioreactor.config import config
def get_from_config(self, key: str, **get_kwargs):
v = config.get(f"{self.job_name}.config", key, **get_kwargs)
if v == "0":
return False
elif v == "1":
return True
else:
return v
BackgroundJobWithDodgingContrib.get_from_config=get_from_config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment