Add the lockout key to the cache.

@param  string $key
@param  int    $decayMinutes
@return void
178445
protected function lockout($key, $decayMinutes)
    {
        $this->cache->add(
            $key.':lockout', Carbon::now()->getTimestamp() + ($decayMinutes * 60), $decayMinutes
        );
    }
1202083
public function store($cacheKey, $value, $minutes = 30)
    {
        $key = array_search($cacheKey, $this->cachedKeys);

        if ($key == false)
        {
            do
            {
                $key = uniqid();
            }
            while ($this->cache->isExisting($key));

            $this->cachedKeys[$key] = $cacheKey;
            $this->storeCachedKeys();
        }

        $this->cache->set($key, $value, $minutes * 60); //=> From seconds
    }
160660
public function track($key, $decayMinutes = 1)
    {
        $this->cache->add($key, 1, $decayMinutes);

        return (int) $this->cache->increment($key);
    }
805728
protected function addKey(string $key) : void
    {
        if (!$this->keyStore->isValidKey($key)) {
            throw new DumpException("The key \"{$key}\" has already been defined previously.");
        }

        $this->keyStore->addKey($key);
    }
489211
public function expireAfter($key, $expire = 0)
    {
        $val = $this->mem->get($key);

        if (isset($val)) {
            return $this->set($key, $val, $expire);
        }

        return false;
    }
353586
public function expireat($key, $timestamp)
    {
        $this->init();
        $result = $this->driver->expireat($key, $timestamp);
        return (bool)$result;
    }
1344339
protected function unlock(string $key)
    {
        if (!isset($this->locks[$key])) {
            throw new InvalidArgumentError('No lock was set on the given key.');
        }

        $awaitable = $this->locks[$key];
        unset($this->locks[$key]);
        $awaitable->resolve();
    }
1111060
function expire( $key ) {
            $this->_logger->entrance( 'key = ' . $key );

            $cache_entry = $this->_options->get_option( $key, false );

            if ( is_object( $cache_entry ) &&
                 isset( $cache_entry->timestamp ) &&
                 is_numeric( $cache_entry->timestamp )
            ) {
                // Set to expired.
                $cache_entry->timestamp = WP_FS__SCRIPT_START_TIME;
                $this->_options->set_option( $key, $cache_entry, true );
            }
        }
375897
public function memcacheSet($key, $value, $expiration = null)
    {
        if ($this->isSingle()) {
            MemcacheKit::set($key, $value, $expiration);
        }
    }
1065583
public function lock($key, $timeout = self::EXPIRE): bool
    {
        // $startTime = time();
        $file = sprintf('%s/%s.lock', $this->options['tmpDir'], md5(__FILE__ . $key));

        if (!$this->fp = fopen($file, 'wb+')) {
            throw new \RuntimeException('open file failed. FILE: ' . $file);
        }

        // LOCK_SH 取得共享锁定（读取的程序）
        // LOCK_EX 取得独占锁定,排它型锁定（写入的程序）
        // LOCK_UN 释放锁定（无论共享或独占）
        $op = $this->options['single'] ? LOCK_EX + LOCK_NB : LOCK_EX;

        // 如果锁定会堵塞的话（EWOULDBLOCK 错误码情况下），可选的第三个参数会被设置为 TRUE。（Windows 上不支持）
        return flock($this->fp, $op, $this->wouldBlock);
    }
1252729
public function prolong($key, $lifetime)
    {
        $item = $this->find($key);

        if (!is_null($item)) {
            $lifetime = $item['lifetime'] + $lifetime;

            $this->put($key, $item['value'], $lifetime, true);
        }
    }
196838
public function put($key, $value, $minutes = 60)
        {
            $this->_cleanCache();
            if (0 >= $minutes) {
                return;
            }

            $this->forget($key);

            $expiration = $this->expiration($minutes);

            $data = array(
                'key'        => $key,
                'value'      => $value,
                'expiration' => $expiration,
                'namespace'  => $this->namespace,
            );
            Data::add('cache', $data);

        }
648313
public function setCacheKey($key)
    {
        $key = preg_replace('/[^\da-z]/i', '', $key);
        if (!empty($key)) {
            $this->cacheKey = $key;
        }
    }
687397
private function setCache(
        string $key, $value, ?int $expires
    ): void {
        $cache = $this->client->getItem($key);
        $cache->set($value);
        $cache->expiresAfter($expires);
        $this->client->save($cache);
    }
1270218
public function detachPersistor($key)
    {
        if (empty($this->persistors[$key])) {

            throw new \InvalidArgumentException(
                'No registered persistor found.',
                DataAggregatorException::PERSISTOR_NOT_FOUND
            );
        }

        unset($this->persistors[$key]);
    }
934801
protected function addWhereBetween(string $key, int $min, int $max): void
    {
        $phMin = $this->addBindingValue($key, $min);
        $phMax = $this->addBindingValue($key, $max);
        $key = $this->quoteName($key);
        $this->statement .= sprintf('%s BETWEEN %s AND %s', $key, $phMin, $phMax);
        $this->statement .= PHP_EOL;
    }
1005555
public function delete($key) 
    {
        $this->stats['execTimes'] ++;
        unset($this->temp[$key]);
        
        $file = $this->getCachePath($key);
        
        clearstatcache();
        if(is_file($file)) {
            $this->waitUnlock($key);
            $this->lock($key);
            @unlink($file);
            $this->unlock($key);
        }
    }