Cache#isExpired is always false with default EXPIRES_IN_. #84
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://github.com/google/google-api-nodejs-client/blob/3d40484947a45b6eca73ef68f3c5a9e545aa250f/lib/cache.js#L94
new Date(fs.statSync(path).mtime).getTime()
will return a number on the order of 1377737486000 (taken from a recently modified file on my filesystem).Cache.EXPIRES_IN_
is, by default, 300000. Thus, only files that were modified within 299999 milliseconds of the epoch will ever be considered expired. The correct logic is as follows:Not sure about test practices, etc, but I've attached some code with this in place.