Volunteer Janitor: Add global enable/disable.

This commit is contained in:
Ben Rog-Wilhelm 2022-11-21 09:04:29 -06:00 committed by Ben Rog-Wilhelm
parent 0f74f6a4e2
commit 5fef5ca908
2 changed files with 3 additions and 0 deletions

View file

@ -129,6 +129,7 @@ app.config['SCORE_HIDING_TIME_HOURS'] = int(environ.get('SCORE_HIDING_TIME_HOURS
app.config['ENABLE_SERVICES'] = bool_from_string(environ.get('ENABLE_SERVICES', False)) app.config['ENABLE_SERVICES'] = bool_from_string(environ.get('ENABLE_SERVICES', False))
app.config['DBG_VOLUNTEER_PERMISSIVE'] = bool(environ.get('DBG_VOLUNTEER_PERMISSIVE', False)) app.config['DBG_VOLUNTEER_PERMISSIVE'] = bool(environ.get('DBG_VOLUNTEER_PERMISSIVE', False))
app.config['VOLUNTEER_JANITOR_ENABLE'] = bool(environ.get('VOLUNTEER_JANITOR_ENABLE', False))
r=redis.Redis(host=environ.get("REDIS_URL", "redis://localhost"), decode_responses=True, ssl_cert_reqs=None) r=redis.Redis(host=environ.get("REDIS_URL", "redis://localhost"), decode_responses=True, ssl_cert_reqs=None)

View file

@ -34,6 +34,8 @@ class VolunteerDutyJanitor(VolunteerDuty):
def get_duty(u: User) -> VolunteerDutyJanitor: def get_duty(u: User) -> VolunteerDutyJanitor:
if not app.config['VOLUNTEER_JANITOR_ENABLE']:
return None
# these could probably be combined into one query somehow # these could probably be combined into one query somehow