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

Don't wait for all metadata to access any item from TTL cache #228

Merged
merged 9 commits into from
Jun 20, 2018

Conversation

wiseoldduck
Copy link
Contributor

No description provided.

Copy link
Collaborator

@garrettmoon garrettmoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wiseoldduck thanks for this contribution! This looks great. Mind addressing the minor comments and I'll merge?

[self unlock];
[self lockAndWaitForKnownState];
if (!_diskStateKnown) {
if (_metadata[key]== nil) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add a space after ]

}

- (void)_locked_initializeDiskPropertiesForFile:(NSURL *)fileURL fileKey:(NSString *)fileKey byteCount:(NSUInteger *)pByteCount {

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extra space

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where what?

return resourceKeys;
}

- (void)_locked_initializeDiskPropertiesForFile:(NSURL *)fileURL fileKey:(NSString *)fileKey byteCount:(NSUInteger *)pByteCount {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to just return byteCount?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, although it's a little less obvious what it is

Whitespace, return fileSize from _locked_initializeDiskPropertiesForFile instead
of taking a NSUInteger *param
@garrettmoon garrettmoon merged commit e3b9d37 into pinterest:master Jun 20, 2018
@garrettmoon
Copy link
Collaborator

Awesome, thanks again!

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