diff --git a/ennstatus/api/views.py b/ennstatus/api/views.py --- a/ennstatus/api/views.py +++ b/ennstatus/api/views.py @@ -115,15 +115,16 @@ def update(): current_app.logger.warning(' '.join([str(e), str(data)])) return str(e), 409, {'Content-Type': 'text/plain'} - try: - server.update_weights() - except NotImplementedError: - pass + if current_app.config['ENNSTATUS_ENABLE_ONIONOO']: + try: + server.update_weights() + except NotImplementedError: + pass - try: - server.update_flags() - except NotImplementedError: - pass + try: + server.update_flags() + except NotImplementedError: + pass try: server.save() diff --git a/ennstatus/config.py b/ennstatus/config.py --- a/ennstatus/config.py +++ b/ennstatus/config.py @@ -36,3 +36,5 @@ def init_app(app): config.setdefault('ENNSTATUS_MOMENTJS_FORMAT', 'DD MMMM YYYY HH:mm:ss') config.setdefault('ENNSTATUS_STRFTIME_FORMAT', '%d %B %Y %H:%M:%S') + + config.setdefault('ENNSTATUS_ENABLE_ONIONOO', False) diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ def _get_requirements(): setup(name='Ennstatus', - version='5.4.7', + version='5.5.0', description=('Ennstatus provides the user with vital information about ' 'the status of the organizations Tor servers.'), author='Frënn vun der Ënn',