Cleans the cache.
348418
public void clean() {
        Instant minAge = Instant.now().minus(storageTimeInSeconds, ChronoUnit.SECONDS);
        synchronized (messages) {
            messages.removeIf(messageRef -> Optional.ofNullable(messageRef.get())
                    .map(message -> !message.isCachedForever() && message.getCreationTimestamp().isBefore(minAge))
                    .orElse(true));
            long foreverCachedAmount = messages.stream()
                    .map(Reference::get)
                    .filter(Objects::nonNull)
                    .filter(Message::isCachedForever)
                    .count();
            messages.removeAll(messages.stream()
                                       .filter(messageRef -> Optional.ofNullable(messageRef.get())
                                               .map(message -> !message.isCachedForever())
                                               .orElse(true))
                                       .limit(Math.max(0, messages.size() - capacity - foreverCachedAmount))
                                       .collect(Collectors.toList()));
        }
    }
590351
public function cleanUpCache()
    {
        $filename = $this->getCodePath();
        $cacheFiles = glob($filename . '?*');
        if ($cacheFiles) {
            foreach ($cacheFiles as $file) {
                if (substr($file, 0, strlen($filename)) !== $filename) continue; // safety net
                @unlink($file);
            }
        }
        $this->_prepared = false;
    }
1271462
public static void clearCaches()
    {
        synchronized (AbstractCache.CACHES) {
            for (final AbstractCache<?> cache : AbstractCache.CACHES) {
                cache.getCache4Id().clear();
                cache.getCache4Name().clear();
                cache.getCache4UUID().clear();
            }
        }
    }
179886
def clearCache():
		
		if os.path.exists(CachedDataManager._cacheDir()) == True:
			shutil.rmtree(CachedDataManager._cacheDir())
1102715
public function clean()
    {
        $this->removeAddenda();
        $this->removeIncompleteSchemaLocations();
        $this->removeNonSatNSNodes();
        $this->removeNonSatNSschemaLocations();
        $this->removeUnusedNamespaces();
    }
295335
public function clear () : void
    {
        $storage = $this->locator->get(AssetStorage::class);
        $cache = $this->locator->get(AssetsCache::class);

        $storage->removeAllStoredFiles();
        $cache->clear();
    }
415414
public void clear() {

        m_cache = null;
        m_objectList.clear();
        m_objectsById.clear();
        m_orderedObjectList.clear();
        m_objectsListsById.clear();
    }
350450
def clean_cache(self, section=None):
        """"""
        self.remove_all_locks()
        if section is not None and "/" in section:
            raise ValueError("invalid section '{0}'".format(section))
        if section is not None:
            path = os.path.join(self._full_base, section)
        else:
            path = self._full_base
        if not os.path.exists(path):
            return
        shutil.rmtree(path)
416223
def clear(self) -> None:
        
        if self._cache_directory is not None:
            # Safety - if there isn't a cache directory file, this probably isn't a valid cache
            assert os.path.exists(self._cache_directory_index), "Attempt to clear a non-existent cache"
            self._load()            # Shouldn't have any impact but...
            for e in self._cache.values():
                if os.path.exists(e.loc):
                    os.remove(e.loc)
            self._cache.clear()
            self._update()
        self._cache = {}
671214
public function clear(): void
    {
        $this->errors = [];
        if (file_exists($this->cacheFileName())) {
            @unlink($this->cacheFileName());
        }
    }
874604
protected function cleanup()
    {
        $this->stmt->closeCursor();

        $this->stmt          = null;
        $this->rsm           = null;
        $this->cache         = [];
        $this->metadataCache = [];

        $this->em
             ->getEventManager()
             ->removeEventListener([Events::onClear], $this);
    }
596542
public void clearAllCaches() {
        logger.warn("beginning request to clear all caches");
        for (final String cacheName : this.cacheManager.getCacheNames()) {
            clearCache(cacheName);
        }
        logger.warn("completed request to clear all caches");
    }
534400
public void clear()
    {
        if (getCache4Id() != null) {
            getCache4Id().clear();
        }
        if (getCache4Name() != null) {
            getCache4Name().clear();
        }
        if (getCache4UUID() != null) {
            getCache4UUID().clear();
        }
    }
295478
protected function clearCaches()
    {
        $this->callSilent('clear-compiled');
        $this->callSilent('cache:clear');
        $this->callSilent('route:clear');
        $this->callSilent('config:clear');
        $this->callSilent('view:clear');
        Cache::flush();
    }
443861
protected function cleanup()
    {
        $this->filesystem->remove($this->tmpFolder);
        $this->root = null;
        $this->urlsets = array();
    }
1318752
public synchronized void clear() {
		try {
			super.clear();
			list.clear();
		} catch (Exception e) {
			log.log(Level.SEVERE, "clear cache: ", e);
		}
	}
63935
def cache_clean(self):
		
		now = time.time()
		keys_for_removal = collections.deque()
		for key, (_, expiration) in self.__cache.items():
			if expiration < now:
				keys_for_removal.append(key)
		for key in keys_for_removal:
			del self.__cache[key]