Remove stale cache.

@param int $count
Size of the chunk.
@param int $time
Time frame to calc stale cache.
421209
public function resetStaleCache($count = 100, $time = 86400) {
    $timer = 'reset_stale_cache';
    Timer::start($timer);

    $result = $this->queryFactory->get(self::ENTITY_TYPE)
      ->condition('field_gfc_created', REQUEST_TIME - $time, '<')
      ->execute();
    if (empty($result)) {
      $this->logger->info('No stale cache was found. Nothing to clear.');
      Timer::stop($timer);
      return;
    }

    $this->removeByChunk($result, $count);

    $msg = 'The stale cache was cleared. [items removed: %items, elapsed time: %time sec.]';
    $this->logger->info(
      $msg,
      [
        '%items' => count($result),
        '%time' => round(Timer::read($timer) / 1000, 1)
      ]
    );

    Timer::stop($timer);
  }
861448
private function setCount(Link $link, $count): void
	{
		if (is_array($count)) {
			$link->setCount($count[0], $count[1]);
		} elseif (is_int($count)) {
			$link->setCount($count);
		} else {
			throw new InvalidArgumentException("Wrong argument 'count'");
		}
	}
515876
public function pop($count = 1)
    {
        $newPath = $this->path->copy();
        for ($i = 0; $i < $count; ++$i) {
            $newPath->pop();
        }

        return $this->replicate(['path' => $newPath]);
    }
853928
public function postDelete(Event $event, $id, $count) {
        if (!$this->getConfig('onDelete') || !$this->_deleteIndex) {
            return;
        }

        $this->_removeNode($id, $this->_deleteIndex);
        $this->_deleteIndex = null;
    }
679485
protected function removeProcesses($count)
    {
        array_splice($this->processes, 0, $count);

        $this->processes = array_values($this->processes);
    }
246950
public function deleteFirst($value, int $count = 1): int
    {
        return $this->handle->lRem($this->name, $value, $count);
    }
583863
protected function cacheCountBetween($count, Carbon $from, Carbon $until, $locale, $cacheKey)
    {
        // Cache only if cacheKey is present
        if ($cacheKey && ($until->timestamp < Carbon::now()->timestamp))
        {
            $key = $this->makeBetweenCacheKey($from, $until, $locale, $cacheKey);

            $this->cache->put($key, $count, 525600);
        }
    }
1059603
public function removeRange($index, $count){
		
		if($this->_ReadOnly){
			throw new ReadOnlyException(\get_called_class() . ' is read only');
		}
		
		if(!$this->offsetExists($index)){
			throw new \OutOfRangeException('$index is invalid');
		}
		
		\array_splice($this->_Arr, $index, $count);
		
		return $this;
		
	}
343107
public function hit($count = 1)
	{
		$hitsLeft = $this->memcached->get($this->key);
		if ($this->memcached->getResultCode() == Memcached::RES_NOTFOUND)
		{
			// this is the first hit
			$hitsLeft = $this->hits;
			$this->memcached->set($this->key, $this->hits, time() + $this->seconds);
		}

		if ($hitsLeft < $count)
		{
			return false;
		}

		if ($this->memcached->decrement($this->key, $count) === false)
		{
			// it failed to decrement
			return false;
		}

		return true;
	}
425685
public function stream_read($count) {
    assert(isset($this->client));
    return $this->client->read($count);
  }
57971
public function setRetries($count, $delay = 0)
    {
        assert(is_int($count) && $count >= 0);
        assert(is_int($delay) && $delay >= 0);
        $this->_retrycount = $count;
        $this->_retrydelay = $delay;

        return $this;
    }
584371
public function outputFileCount(int $count): void
    {
        if (OutputInterface::VERBOSITY_NORMAL === $this->io->getVerbosity()) {
            $this->progressBar = $this->io->createProgressBar($count);
            $this->progressBar->start();
        } elseif ($this->io->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
            $this->progressBar = new ProgressBar(new NullOutput());
        }
    }
379214
public function update( $count ) {
		update_post_meta(
			$this->post_id,
			'_inc2734_count_cache_' . $this->service_name,
			[
				'count'      => $count,
				'expiration' => time() + (int) apply_filters( 'inc2734_wp_share_buttons_count_cache_seconds', 60 * 5 ),
			]
		);
	}
558218
protected static function arrayRemoveFirst(Array $array, Int $count = 1) : Array
    {
        for( $i = 0; $i < $count; $i++ )
        {
            array_shift($array);
        }

        return $array;
    }
1123919
public static function repeatHourlyForTotalCount($count, $hours = 1) {
        if($count < 1) {
            throw new \InvalidArgumentException(sprintf('Total count of firings must be at least one! Given count: "%s"', $count));
        }

        return static::simpleSchedule()
            ->withIntervalInHours($hours)
            ->withRepeatCount($count - 1);
    }
1339602
public synchronized void removeTimestamp(long ts) throws NoSuchElementException {
    Preconditions.checkState(!closed, "tracker closed ");
    Preconditions.checkState(allocationsInProgress > 0,
        "allocationsInProgress should be > 0 " + allocationsInProgress);
    Objects.requireNonNull(node);
    if (timestamps.remove(ts) == false) {
      throw new NoSuchElementException(
          "Timestamp " + ts + " was previously removed or does not exist");
    }

    allocationsInProgress--;
  }
431969
public function delete($key, $time = 0)
    {
        $keyString = $this->getKey($key);
        $this->writeSocket("delete $keyString");

        $s = $this->readSocket();
        if ('DELETED' == $s) {
            $this->resultCode = Memcached::RES_SUCCESS;
            $this->resultMessage = '';
            return true;

        } else {
            $this->resultCode = Memcached::RES_NOTFOUND;
            $this->resultMessage = 'Delete fail, key not exists.';
            return false;
        }
    }