Removes the expired data values.
@param bool $force whether to enforce the garbage collection regardless of [[gcProbability]].
Defaults to false, meaning the actual deletion happens with the probability as specified by [[gcProbability]].
429624
public function gc($force = false)
    {
        if ($force || mt_rand(0, 1000000) < $this->gcProbability) {
            $this->db->getCollection($this->cacheCollection)
                ->remove([
                    'expire' => [
                        '$gt' => 0,
                        '$lt' => time(),
                    ]
                ]);
        }
    }
1092108
public function leave(bool $force = false)
    {
        $url = $this->url.'/leave?'.http_build_query(['force' => $force]);

        return $this->curl->post($url);
    }
122187
public function findAllToRefreshToken(bool $force = false)
    {
        $query = $this->newQuery();

        return $force ? $query->get() : $query->whereNull('token')->get();
    }
1054454
public function gc($force = false)
    {
        if ($force || mt_rand(0, 100) < $this->_gcProbability) {
            $latestExistsTime = time() - 60 * 60 * $this->_gcExportOutOfDateHours;
            $latestPrefix = date('ymd-Hi', $latestExistsTime);
            
            $flist = FileHelper::findFiles($this->tmpDir);
            foreach ($flist as $file) {
                // delete by storing time expired
                $fileTime = filectime($file);
                $cmpTime = $fileTime - $latestExistsTime;
                if ($cmpTime < 0) @unlink($file);

                // delete by filename analyse
                $filePrefix = substr(basename($file), 0, 11);
                $cmpPrefix = strncmp($filePrefix, $latestPrefix, 11);
                if ($cmpPrefix < 0) @unlink($file);
            }
        }
    }
655208
def delete(self, force=False):
        
        if force:
            RecordsBuckets.query.filter_by(
                record=self.model,
                bucket=self.files.bucket
            ).delete()
        return super(Record, self).delete(force)
496477
public static function rm($force = false, $remove_volumes = false)
    {
        $args = [];
        if ($force) {
            $args[] = '-f';
        }
        if ($remove_volumes) {
            $args[] = '-v';
        }
        return self::runCommand('rm', $args);
    }
1090281
public function hasCache($force = FALSE) {

		if(!isset($this->cacheFound) || $force) {
			$this->cacheFound = is_dir($this->path . self::CACHE_PATH);
		}

		return $this->cacheFound;

	}
938962
function ldap_close($force=false) {
        $this->ldapconns--;
        if (($this->ldapconns == 0) || ($force)) {
            $this->ldapconns = 0;
            @ldap_close($this->ldapconnection);
            unset($this->ldapconnection);
        }
    }
527878
public function beforeDelete( $forced = false )
  {
    try {
        if($this->resourceLog) {
            $this->resourceLog->delete();
        }
    } catch(Execption $e) {}

    return true;
  }
978295
public function beforeDelete( $forced = false )
  {
    try {
      \DB::table(Config::get('workflow::node_user_table'))->where('node_id', $this->id)->delete();
      \DB::table(Config::get('workflow::node_role_table'))->where('node_id', $this->id)->delete();
    } catch(Execption $e) {}

    return true;
  }
251273
public function cacheConfig($force = false)
    {
        if ($this->cacheFile->exists() && $force === false) {
            return;
        }
        $this->cacheFile->dump($this->data);
    }
273211
public function delete($filter = true)
    {
        $this->trackUsage();
        $rows = $this->load($filter);

        if ($rows) {
            foreach ($rows as $row) {
                if (isset($row['gro_id_round'])) {
                    $roundId = $row['gro_id_round'];
                    if ($this->isDeleteable($roundId)) {
                        $this->db->delete('gems__rounds', $this->db->quoteInto('gro_id_round = ?', $roundId));

                        // Delete the round before anyone starts using it
                        $this->db->delete('gems__tokens', $this->db->quoteInto('gto_id_round = ?', $roundId));
                    } else {
                        $values['gro_id_round'] = $roundId;
                        $values['gro_active']   = 0;
                        $this->save($values);
                    }
                    $this->addChanged();
                }
            }
        }
    }
511045
public function remove(string $name, bool $force = false, bool $noprune = false)
    {
        $data = [
            'force' => $force,
            'noprune' => $noprune,
        ];

        $url = self::$base_url.'/'.$name.'?'.http_build_query($data);

        return self::$curl->delete($url);
    }
509076
public function flushCacheState(bool $force = false): void
    {
        if ((!empty($this->newCacheState) && is_writable($this->cacheDir)) || $force) {
            $fullCacheMap = $this->newCacheState + $this->cacheState;
            $cachePath    = substr(var_export($this->cacheDir, true), 1, -1);
            $rootPath     = substr(var_export($this->appDir, true), 1, -1);
            $cacheData    = '<?php return ' . var_export($fullCacheMap, true) . ';';
            $cacheData    = strtr($cacheData, [
                '\'' . $cachePath => 'AOP_CACHE_DIR . \'',
                '\'' . $rootPath  => 'AOP_ROOT_DIR . \''
            ]);
            $fullCacheFileName = $this->cacheDir . self::CACHE_FILE_NAME;
            file_put_contents($fullCacheFileName, $cacheData, LOCK_EX);
            // For cache files we don't want executable bits by default
            chmod($fullCacheFileName, $this->fileMode & (~0111));

            if (function_exists('opcache_invalidate')) {
                opcache_invalidate($fullCacheFileName, true);
            }
            $this->cacheState    = $this->newCacheState + $this->cacheState;
            $this->newCacheState = [];
        }
    }
338821
public function beforeDelete( $forced = false )
  {
    try {

        if($this->resourcenodes){
            $this->resourcenodes->each(function($node){
                $node->delete();
            });
        }
    } catch(Execption $e) {}

    return true;
  }
602599
protected function touch($force = false)
    {
        if (true === $this->getState()->is('deleted')) {
            return $this;
        }
        if (true === $this->getState()->is('empty') || true === $force) {
            $record = $this->store->retrieveRecord($this->getType(), $this->getId());
            $this->initialize($record['properties']);
            $this->getState()->setLoaded();
        }
        return $this;
    }
697220
public function delete($deleteReference = false)
    {
        $returnValue = (bool) false;
        $returnValue = $this->getImplementation()->delete($this, $deleteReference);
        return (bool) $returnValue;
    }