Skip to content

Commit

Permalink
Merge pull request #558 from yanyin1986/master
Browse files Browse the repository at this point in the history
init _cacheQueue when AVCacheManager init.
  • Loading branch information
zapcannon87 authored Apr 14, 2019
2 parents 202f5b9 + 8a4140c commit b5cdf84
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions AVOS/AVOSCloud/Cache/AVCacheManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ + (AVCacheManager *)sharedInstance {
return _sharedInstance;
}

- (instancetype)init {
self = [super init];
if (self) {
_cacheQueue = dispatch_queue_create("avos.paas.cacheQueue", DISPATCH_QUEUE_SERIAL);
}
return self;
}

#pragma mark - Accessors
+ (NSString *)path {
return [AVPersistenceUtils avCacheDirectory];
Expand All @@ -46,13 +54,6 @@ - (NSString *)diskCachePath {
return _diskCachePath;
}

- (dispatch_queue_t)cacheQueue {
if (!_cacheQueue) {
_cacheQueue = dispatch_queue_create("avos.paas.cacheQueue", DISPATCH_QUEUE_SERIAL);
}
return _cacheQueue;
}

- (NSString *)pathForKey:(NSString *)key {
return [self.diskCachePath stringByAppendingPathComponent:key];
}
Expand Down

0 comments on commit b5cdf84

Please sign in to comment.