-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
I came across the following scenario:
I have a cache file that I would like to flush on every app update. With the current implementation MTMigration it currently looks like:
[MTMigration applicationUpdateBlock:^{
flushCache();
}];
if (isCacheAvailable) { // (1)
loadCache();
} else {
writeCache();
}However, unless a synchronization method is introduced, there is no guarantee that the cache file will be flushed before (1).
Adding a hasAppBeenUpdated property would allow the synchronous execution of code in an easier way:
if (isCacheAvailable &&
[MTMigration hasAppBeenUpdated] == NO) {
loadCache();
} else {
writeCache();
}Let me know what you think, @pwightman
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels