Skip to content

Add NullCacheAdapter #2636

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 3 commits into from
Sep 7, 2016

Conversation

yuki-takeichi
Copy link
Contributor

NullCacheAdapter disables in-memory cache explicitly in order to prevent cache inconsistency between multiple servers.

@yuki-takeichi
Copy link
Contributor Author

Tests failed but it is not my fault.

@codecov-io
Copy link

codecov-io commented Sep 1, 2016

Current coverage is 92.12% (diff: 100%)

Merging #2636 into master will increase coverage by 0.04%

@@             master      #2636   diff @@
==========================================
  Files            99        101     +2   
  Lines         12113      12304   +191   
  Methods        1488       1529    +41   
  Messages          0          0          
  Branches       1996       2022    +26   
==========================================
+ Hits          11154      11335   +181   
- Misses          959        969    +10   
  Partials          0          0          

Powered by Codecov. Last update ac11e03...c456ced

@flovilmart
Copy link
Contributor

flovilmart commented Sep 1, 2016

@yuki-takeichi thanks for the PR. We're cautious adding come additional adapter to the main code base. The biggest pain point is that to access them, you need to know the internal path of that said adapter and that prevent maintainers from doing extra refactoring (like what happened to the FileLoggerAdapter when renamed to WinstonLoggerAdapter).

I know it's a lot to ask, but could you add a module that would be accessed with:

const NullCacheAdapter = require('parse-server').NullCacheAdapter;

Do you think that's possible?

Thanks.

}

clear() {
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll fix it.

@ghost
Copy link

ghost commented Sep 7, 2016

@yuki-takeichi updated the pull request - view changes

@ghost
Copy link

ghost commented Sep 7, 2016

@yuki-takeichi updated the pull request - view changes

@yuki-takeichi
Copy link
Contributor Author

yuki-takeichi commented Sep 7, 2016

@flovilmart
Thanks for reviewing!
Is c456ced what you want?

BTW, I can't find out the reason why
https://github.com/ParsePlatform/parse-server/blob/master/spec/index.spec.js#L250
is correct behavior.
So I don't have confidence to add this line: c456ced#diff-34eeea22d611a12d47230ee1ebae43ffR251.
Cloud you please tell me why Parse.InMemoryCacheAdapter and other adapters are expected to throw here?

Regards,

@flovilmart
Copy link
Contributor

That looks good to me.

@flovilmart
Copy link
Contributor

It throws something like: TypeError: Cannot call a class as a function as it's a class called as a function. We may wanna be more expressive :)

@flovilmart flovilmart merged commit fe62e92 into parse-community:master Sep 7, 2016
@yuki-takeichi yuki-takeichi deleted the null-cache-adapter branch September 8, 2016 01:36
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.

3 participants