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

Resetting after fileCache expires cannot immediately obtain values #20300

Open
luguohuakai opened this issue Dec 19, 2024 · 4 comments
Open

Resetting after fileCache expires cannot immediately obtain values #20300

luguohuakai opened this issue Dec 19, 2024 · 4 comments
Assignees
Labels
status:to be verified Needs to be reproduced and validated.

Comments

@luguohuakai
Copy link

luguohuakai commented Dec 19, 2024

What steps will reproduce the problem?

$rs = Yii::$app->cache->set('k', 'v', 5);
var_dump($rs);
var_dump(Yii::$app->cache->get('k'));

What is the expected result?

bool(true)
string(1) "v"

What do you get instead?

bool(true)
bool(false)

Additional info

The first execution returned no problem. When k was reexecuted after 5 seconds expired, the returned result was wrong and I couldn't get the value immediately.

Q A
Yii version 2.0.50
PHP version 8.1.27
Operating system openEuler
@bizley
Copy link
Member

bizley commented Dec 19, 2024

What kind of cache is it?

@samdark
Copy link
Member

samdark commented Dec 19, 2024

Is it file, DB, memcache, Redis?

@luguohuakai
Copy link
Author

What kind of cache is it?

file

'components' => [
    'cache' => [
        'class' => 'yii\caching\FileCache'
    ],
]

@luguohuakai
Copy link
Author

Is it file, DB, memcache, Redis?

file

@samdark samdark added status:to be verified Needs to be reproduced and validated. and removed status:need more info labels Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:to be verified Needs to be reproduced and validated.
Projects
None yet
Development

No branches or pull requests

4 participants