-
Notifications
You must be signed in to change notification settings - Fork 376
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
Data cache leaking? #5
Comments
Hmmm... interesting.. I never thought about that. I try to use singletons when fetching data to avoid having 2 instances in memory and changing one and the other getting outdated.. the only way of avoiding this is having an option to disable singletons. |
You can now do this for the entire Examples: var Person = db.define('person', {
// ...
}, {
cache: false // disable globally
});
Person.find({ ... }, { cache: false }, cb); // disable locally I still have to check the associations but I think that's simple now. |
Associations for now are affected by the global parameter. |
Tested and verified, thanks! |
Consider these models:
When calling this piece of code (I'll name it snippet A, as I'll refer back to it later on) ...
... and then outputting
movies
on screen in thecallback
you get this dataset for example:When then calling a different URL on the app to fetch one single movie with genres ...
... we get back this when outputting
movie
from within the secondcallback
Now comes the kicker: when now visiting the URL that executes snippet A again, you get back this dataset:
As you can see the genres mysteriously appear here now, which shouldn't be the case.
The text was updated successfully, but these errors were encountered: