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

Fix subscriptions storage manager TTL #1307

Merged
merged 3 commits into from
Apr 19, 2020
Merged

Fix subscriptions storage manager TTL #1307

merged 3 commits into from
Apr 19, 2020

Conversation

stayallive
Copy link
Collaborator

@stayallive stayallive commented Apr 19, 2020

Changes

This fixes the inconsistent cache TTL for Laravel 5.5-5.7 / 5.8+ in the subscription storage manager introduced in #1284.

We already use this code to do this in other cache related code in Lighthouse.

Also added the dependency on Carbon since we use that in this package directly, got the version constraints from the 5.5 and 7.x branch of laravel/framework.

Breaking changes

None. Changes are not released yet.

Restrict to the latest 5.5 & 7.x versions.
The TTL argument on cache calls is in minutes in Laravel 5.5-5.7 and changed to seconds on Laravel 5.8+, passing a Carbon instance makes sure our TTL in seconds is always correct.
@stayallive stayallive changed the title Fix subscriptions ttl Fix subscriptions storage manager TTL Apr 19, 2020
@spawnia
Copy link
Collaborator

spawnia commented Apr 19, 2020

How are they inconsistent?

composer.json Outdated Show resolved Hide resolved
@stayallive
Copy link
Collaborator Author

In Laravel 5.5-5.7 the TTL argument was in minutes (or Carbon).

But in 5.8 that changed to seconds (or Carbon).

So this way it is always in seconds (we document it is in seconds in the config file).

https://laravel-news.com/cache-ttl-change-coming-to-laravel-5-8

@spawnia spawnia merged commit 6b8866b into master Apr 19, 2020
@spawnia spawnia deleted the fix-subscriptions-ttl branch April 19, 2020 14:11
spawnia pushed a commit that referenced this pull request Apr 19, 2020
The TTL argument on cache calls is in minutes in Laravel 5.5-5.7 and changed to seconds on Laravel 5.8+, passing a Carbon instance makes sure our TTL in seconds is always correct.
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

Successfully merging this pull request may close these issues.

2 participants