@instrumented_task(name='sentry.tasks.options.sync_options', queue='options')
def sync_options(cutoff=ONE_HOUR):
 cutoff_dt = (timezone.now() - timedelta(seconds=cutoff))
 for option in Option.objects.filter(last_updated__gte=cutoff_dt).iterator():
  try:
   opt = default_manager.lookup_key(option.key)
   default_manager.store.set_cache(opt, option.value)
  except UnknownOption as e:
   logger.exception(six.text_type(e))

@ instrumented_task ( name = 'sentry.tasks.options.sync_options' , queue = 'options' ) def sync_options ( cutoff = ONE_HOUR ) : cutoff_dt = ( timezone . now ( ) - timedelta ( seconds = cutoff ) ) for option in Option . objects . filter ( last_updated__gte = cutoff_dt ) . iterator ( ) : try : opt = default_manager . lookup_key ( option . key ) default_manager . store . set_cache ( opt , option . value ) except UnknownOption as e : logger . exception ( six . text_type ( e ) )
ensures all options that have been updated since cutoff have their correct values stored in the cache .