Reduce API response times by caching migration flag

This commit is contained in:
AlanCoding
2019-11-04 22:28:49 -05:00
parent 04c535e3f9
commit 5433af6716
3 changed files with 24 additions and 5 deletions

View File

@@ -263,6 +263,12 @@ def apply_cluster_membership_policies():
logger.debug('Cluster policy computation finished in {} seconds'.format(time.time() - started_compute))
@task(queue='tower_broadcast_all', exchange_type='fanout')
def set_migration_flag():
logger.debug('Received migration-in-progress signal, will serve redirect.')
cache.set('migration_in_progress', True)
@task(queue='tower_broadcast_all', exchange_type='fanout')
def handle_setting_changes(setting_keys):
orig_len = len(setting_keys)