Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SETEX command is regarded as deprecated since 2.6.12 #422

Open
beeyev opened this issue Jun 9, 2023 · 0 comments
Open

SETEX command is regarded as deprecated since 2.6.12 #422

beeyev opened this issue Jun 9, 2023 · 0 comments

Comments

@beeyev
Copy link

beeyev commented Jun 9, 2023

SETEX is deprecated
Could you please update the code to support SET ?

    public function storeData($key, $data, $expiration)
    {
        $store = serialize(array('data' => $data, 'expiration' => $expiration));
        if (is_null($expiration)) {
            return $this->redis->set($this->makeKeyString($key), $store);
        } else {
            $ttl = $expiration - time();

            // Prevent us from even passing a negative ttl'd item to redis,
            // since it will just round up to zero and cache forever.
            if ($ttl < 1) {
                return true;
            }

            return $this->redis->setex($this->makeKeyString($key), $ttl, $store);
        }
    }

https://github.com/tedious/Stash/blob/main/src/Stash/Driver/Redis.php#L213

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant