Handle the purge cache option.
488818
protected void handlePurgeCache() {
        reportable.output("Purging all resources from the cache");

        try {
            cacheMgrService.purgeResources();
        } catch (Exception e) {
            reportable.error("Unable to remove all resources in the cache");
            reportable.error("Reason: " + e.getMessage());
            bail(GENERAL_FAILURE);
        }
    }
581013
def clear(self):
        """"""
        if self._cache is not None:
            with self._cache as c:
                c.clear()
                c.out_deque.clear()
560781
def handle(self, *args, **options):
        """"""
        self.verbosity = int(options.get('verbosity'))
        self.quiet = options.get('quiet')
        self._set_logger_level()

        try:
            connection.close()
            self.filename = options.get('input_filename')
            self.path = options.get('input_path')
            self.servername = options.get('servername')
            self.decrypt = options.get('decrypt')
            self.uncompress = options.get('uncompress')
            self.passphrase = options.get('passphrase')
            self.interactive = options.get('interactive')
            self.database_name, self.database = self._get_database(options)
            self.storage = get_storage()
            self._restore_backup()
        except StorageError as err:
            raise CommandError(err)
772332
public void purgeCache() {
        synchronized (users) {
            users.values().stream()
                    .map(Reference::get)
                    .filter(Objects::nonNull)
                    .map(Cleanupable.class::cast)
                    .forEach(Cleanupable::cleanup);
            users.clear();
        }
        userIdByRef.clear();
        servers.values().stream()
                .map(Cleanupable.class::cast)
                .forEach(Cleanupable::cleanup);
        servers.clear();
        channels.values().stream()
                .filter(Cleanupable.class::isInstance)
                .map(Cleanupable.class::cast)
                .forEach(Cleanupable::cleanup);
        channels.clear();
        unavailableServers.clear();
        customEmojis.clear();
        messages.clear();
        messageIdByRef.clear();
        timeOffset = null;
    }
306649
def process_delete(self, obj, pk_set=None, action=None, update_fields=None, **kwargs):
        """"""
        build_kwargs = self.delete_cache.take(obj)

        if build_kwargs:
            self.index.build(**build_kwargs)
213982
def cache_clear(self):
		""""""
		with self.cache_lock:
			cursor = self.cache_db.cursor()
			cursor.execute('DELETE FROM cache')
			self.cache_db.commit()
		self.logger.info('the RPC cache has been purged')
		return
1057343
protected function tearDown()
    {
        foreach ($this->purgePaths as $path) {
            if (file_exists($path)) {
                $this->purgePath($path);
            }
        }
    }
1347117
void purge() {

        uncommittedCache.clear();

        try {
            if (cacheReadonly) {
                close(false);
            } else {
                if (dataFile != null) {
                    dataFile.close();

                    dataFile = null;
                }

                FileUtil.getDefaultInstance().delete(fileName);
            }
        } catch (Exception e) {
            throw Error.error(ErrorCode.FILE_IO_ERROR,
                              ErrorCode.M_TextCache_purging_file_error,
                              new Object[] {
                fileName, e
            });
        }
    }
242108
function purgeResource(resource, archive) {
        if (!resource.purge) { return true; }

        var criteria = resource.purge();
        var deferred = Q.defer();

        archive.bind(resource.name);
        archive[resource.name].remove(criteria, function (err, results) {
            err ? deferred.reject(err) : deferred.resolve(results);
        });
        return deferred.promise;
    }
1021346
public function handleClearCacheACL(): void
	{
		if ($this->isAjax()) {
			$this->authorizatorFactory->cleanCache();
			$this->flashNotifier->success('cms.permissions.aclCacheCleared');
		} else {
			$this->terminate();
		}
	}
747576
public function cleanup(): void
    {
        foreach ($this->getStore() as $key => $value)
        {
            $this->remove($key);
        }
    }
753526
def cleanup(self):
        '''
        
        '''
        log.debug('ConCache cleaning up')
        if os.path.exists(self.cache_sock):
            os.remove(self.cache_sock)
        if os.path.exists(self.update_sock):
            os.remove(self.update_sock)
        if os.path.exists(self.upd_t_sock):
            os.remove(self.upd_t_sock)
92821
public function handleRemove() {
		$id = $this->request->getQuery("id");
		$token = $this->request->getQuery("token");
		$default = $this->request->getQuery("default", 0);
		
		if($default == 0) {
			$cache = $this->uploadControl->getCache();
			/** @noinspection PhpInternalEntityUsedInspection */
			$cacheFiles = $cache->load($this->uploadControl->getTokenizedCacheName($token));
			if(isset($cacheFiles[ $id ])) {
				/** @noinspection PhpInternalEntityUsedInspection */
				$this->uploadControl->getUploadModel()->remove($cacheFiles[ $id ]);
				unset($cacheFiles[ $id ]);
				/** @noinspection PhpInternalEntityUsedInspection */
				$cache->save($this->uploadControl->getTokenizedCacheName($token), $cacheFiles);
			}
		} else {
			$files = $this->uploadControl->getDefaultFiles();
			
			foreach($files as $file) {
				if($file->getIdentifier() == $id) {
					$file->onDelete($id);
				}
			}
		}
	}
371817
def purge(options = {})
      options = options.merge(queue_url: @url)
      resp = @client.purge_queue(options)
      resp.data
    end
861627
def flush_cache(self, properties=None):
        
        if hasattr(self, '_cache'):
            if properties is None:
                del(self._cache)
            else:
                for prop in properties:
                    if prop in self._cache:
                        del(self._cache[prop])
345953
def delete(self):
        """"""

        key = self._key(self._all_keys())
        _cache.delete(key)
772110
public void purge() {
		long startTime=System.currentTimeMillis();
		long objectPurged=0;
		
		Set<Map.Entry<String, T>> set=map.entrySet();
		
		long time=System.currentTimeMillis()-minUnactiveTime;
		
		for (Iterator<Map.Entry<String, T>> i=set.iterator();i.hasNext();){
			Map.Entry<String, T> entry=i.next();
			T object=entry.getValue();
			
			// Check if the object has to be removed from the cache
			if (object.getLastAccess()<time && object.canPurge() ){
				i.remove();
				objectPurged++;
			}
		}
		
		if (log.isInfoEnabled()){
			if (objectPurged==0){
				if (log.isDebugEnabled()){
					log.info("Cache:"+name+
							 " Purged:"+objectPurged+
							 " Time:"+(System.currentTimeMillis()-startTime));
				}
			} else {
				log.info("Cache:"+name+
						 " Purged:"+objectPurged+
						 " Time:"+(System.currentTimeMillis()-startTime));
			}
		}
		
	}