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

Add convenient method to clean all loaded (cached) instances #140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Kjuly
Copy link
Contributor

@Kjuly Kjuly commented Jul 7, 2016

Hi @marcoarment ,

Like issue mentioned in #106, when we cleaned several tables' records locally (execute sql statement directly) & try to pull data from server, these cached records will lead some problems.

e.g., we use updatedAt to judge whether need to update local record w/ the one fetched from server. As cached record will always have a same updatedAt to the one fetched from server, as a result, when cleaned local data & pull again from server, no new record will be created locally after pulling, cause we think these record exists & values are latest. Especially for the case that fetch big records one by one.

Though there's a way to load all cached instances w/ +allLoadedInstances and remove one by one w/ -removeFromCache, I think it's good to provide a convenient method to remove the whole cached array in g_instances at once. :)

@Kjuly Kjuly force-pushed the pr+cleanAllLoadedInstances branch from b8e1083 to eb906b8 Compare July 10, 2016 12:31
@Kjuly
Copy link
Contributor Author

Kjuly commented Jul 10, 2016

Note: Updated the PR based on latest commit after merging Unique2 br.

@Kjuly
Copy link
Contributor Author

Kjuly commented Aug 5, 2016

Hi @marcoarment , plz take a review when u got time, and let me know if u've any concern about it, thx in advance.

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.

1 participant