-
Notifications
You must be signed in to change notification settings - Fork 591
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
[Cache] removeAll: remove all files in cache path #267
Conversation
…ormat was registered or not
} | ||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) { | ||
let timeout = dispatch_time(DISPATCH_TIME_NOW, Int64(60 * NSEC_PER_SEC)) | ||
dispatch_group_wait(group, timeout); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't want to check the return value ? at least for log ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dcharbonnier Good call.
this is suspicious :
I think it should be
|
override func tearDown() {
let semaphore = dispatch_semaphore_create(0)
sut.removeData() {
dispatch_semaphore_signal(semaphore)
}
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER)
super.tearDown()
} Which basically makes |
right, removeAllData or removeAll ? |
Both. Same problem in DiskCacheTests. |
Actually, what I posted is wrong as it would block the main queue. Threading is hard. Will revisit in a bit. |
[Cache] removeAll: remove all files in cache path
Remove all files in cache path no matter if the format was registered or not. Fixes #125.