-
-
Notifications
You must be signed in to change notification settings - Fork 453
Expiration date bug with sqlite driver #560
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
Comments
Test data created with the code above, first with 30 days, second with 31. The first one has both dates, in the object and exp columns right, but the second one not. Something goes wrong when writing to the db.
|
I think that function here this is the root cause of the problem.
|
This function was made for some backed such as memcache that take dynamic
TTL.
I'll investigate.
Cheers,
Georges.L
|
You right, It seem that we are dealing with dead code here. Thanks. |
Okay I got it :) Don't worry, this "expiration" column is no longer really used internally :) Currently the Sqlite "is working well" *, but it's still storing wrong (but unused data). For compatibility reason I'll keep this column in the V6 && V5, but it will deleted in the V7. However... Really thanks for this report @wloske :) |
(cherry picked from commit fcdcc3a)
Thanks for the report. Cheers, |
All the majors versions just got a new release: Cheers, |
(cherry picked from commit c1752b8)
Fixed randomly failing test Github-#560
Configuration:
PhpFastCache version:
6.0.8
PHP version:
7.0.6
Operating system:
win
Issue description:
I think there's a severe error in expiration date handling somewhere. When I set my cacheTTL to
60 * 60 * 24 * 30
which is 30 days, everything works fine. However, when I ramp it up to 31 days, somehow the expiration date in the database is not correct anymore.I am using the sqlite driver. For 30 days I get
exp = 1518191956
but for 31 days I getexp = 3033878630
.When I dump the cacheItem object right after having set the TTL, it contains the right date. It also contains the right date, when having set the
defaultTtl
config value but still enters the wrong date into the database.My code looks basically like this:
The text was updated successfully, but these errors were encountered: