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

Psr16Adapter get item even if it is expired #545

Closed
piernik opened this issue Nov 27, 2017 · 6 comments
Closed

Psr16Adapter get item even if it is expired #545

piernik opened this issue Nov 27, 2017 · 6 comments

Comments

@piernik
Copy link

piernik commented Nov 27, 2017

Configuration:

PhpFastCache version: 6
PHP version: 7.0
Operating system: widnows 10

Issue description:

As in topic. I think that adapter's get method does not check expiration date. I think it should. I use files strategy

@Geolim4
Copy link
Member

Geolim4 commented Nov 27, 2017

Hello,

What do you mean by:

I think that adapter's get method does not check expiration date

The file is tested:
https://github.com/PHPSocialNetwork/phpfastcache/blob/final/tests/Psr16Adapter.test.php#L1

And the tests are passing ?
https://travis-ci.org/PHPSocialNetwork/phpfastcache/jobs/307150874#L771

Cheers,
georges

@piernik
Copy link
Author

piernik commented Nov 27, 2017

I set new item with time to be valid set('key','value', 10);.
After 15 seconds I fetch it with get('key'). I get value instead of null as it should be invalid.

@Geolim4
Copy link
Member

Geolim4 commented Nov 27, 2017

After the 15 seconds are you still in the same process ?

@piernik
Copy link
Author

piernik commented Nov 27, 2017

Yes - for tests I give sleep(15). But in Psrl6Adapter I see no $item->isExpired() call.
BTW: great class name ;)

@Geolim4
Copy link
Member

Geolim4 commented Nov 27, 2017

You right, I'm storing the cache item in memory, this is maybe more a design issue more rather than a bug.
The psr-16 documentation is not really clear about it :/

BTW: great class name ;)

KISS principle :)

Geolim4 added a commit that referenced this issue Nov 27, 2017
@Geolim4 Geolim4 added this to Todo in V6 Roadmap via automation Nov 27, 2017
@Geolim4 Geolim4 added this to the 6.0.7 milestone Nov 27, 2017
@Geolim4 Geolim4 moved this from Todo to In progress in V6 Roadmap Nov 27, 2017
Geolim4 added a commit that referenced this issue Nov 27, 2017
V6 Roadmap automation moved this from In progress to Done Nov 27, 2017
@Geolim4
Copy link
Member

Geolim4 commented Nov 27, 2017

The next release is planned in a couple of weeks, if you can't wait until then you can use dev-master.

Cheers,
Georges

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
V6 Roadmap
  
Done
Development

No branches or pull requests

2 participants