

def _remove_expired_items_from_cache(self):
    'Remove expired items from temporary URL cache\n\n        This function removes entries that will expire before the expected\n        usage time.\n        '
    max_valid_time = (int(time.time()) + CONF.glance.swift_temp_url_expected_download_start_delay)
    keys_to_remove = [k for (k, v) in six.iteritems(self._cache) if (v.url_expires_at < max_valid_time)]
    for k in keys_to_remove:
        del self._cache[k]

dataset/ETHPy150Open openstack/ironic/ironic/common/glance_service/v2/image_service.py GlanceImageService._remove_expired_items_from_cache/original