Skip to content

Cache: create dependencies when closing macro #49

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

Merged
merged 1 commit into from
Jan 29, 2017
Merged

Cache: create dependencies when closing macro #49

merged 1 commit into from
Jan 29, 2017

Conversation

vitkutny
Copy link
Contributor

@vitkutny vitkutny commented Jan 2, 2017

  • bug fix? no
  • BC break? no

prevents invalid expiration from dependencies callback when caching time-expensive data

example of code causing problem:

$dependencies = function () {
	return [Cache::Expiration => new DateTime('+1 second')];
};
{cache foo dependencies => $dependencies}
	{php sleep(2)} {* loading data *}
	bar
{cache}

current behaviour:
content is cached with zero expiration (-1 second)

expected behaviour:
content is cached for 1 second

- prevents invalid expiration from dependencies callback when caching time-expensive data
@dg dg force-pushed the master branch 3 times, most recently from 492413c to b0b475e Compare January 9, 2017 20:11
@dg dg force-pushed the master branch 4 times, most recently from 6037e83 to 1fe69cc Compare January 13, 2017 07:34
@dg dg force-pushed the master branch 6 times, most recently from 1655c0f to 7c885a2 Compare January 25, 2017 01:39
@dg dg force-pushed the master branch 3 times, most recently from 29c60cc to 62bf8ec Compare January 29, 2017 20:21
@dg dg merged commit ab673cc into nette:master Jan 29, 2017
dg pushed a commit that referenced this pull request Jan 29, 2017
- prevents invalid expiration from dependencies callback when caching time-expensive data
dg pushed a commit that referenced this pull request Jan 29, 2017
- prevents invalid expiration from dependencies callback when caching time-expensive data
@vitkutny vitkutny deleted the cache-dependencies branch February 12, 2017 16:44
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