diff --git a/redbeat/schedulers.py b/redbeat/schedulers.py index 94b36a3..178809a 100644 --- a/redbeat/schedulers.py +++ b/redbeat/schedulers.py @@ -101,12 +101,11 @@ def ensure_conf(app): """ name = 'redbeat_conf' app = app_or_default(app) - try: - config = getattr(app, name) - except AttributeError: - config = RedBeatConfig(app) - setattr(app, name, config) + if hasattr(app, name): + return getattr(app, name) + config = RedBeatConfig(app) + setattr(app, name, config) return config