Skip to content

Commit b5cdf84

Browse files
authored
Merge pull request #558 from yanyin1986/master
init _cacheQueue when AVCacheManager init.
2 parents 202f5b9 + 8a4140c commit b5cdf84

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

AVOS/AVOSCloud/Cache/AVCacheManager.m

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ + (AVCacheManager *)sharedInstance {
3434
return _sharedInstance;
3535
}
3636

37+
- (instancetype)init {
38+
self = [super init];
39+
if (self) {
40+
_cacheQueue = dispatch_queue_create("avos.paas.cacheQueue", DISPATCH_QUEUE_SERIAL);
41+
}
42+
return self;
43+
}
44+
3745
#pragma mark - Accessors
3846
+ (NSString *)path {
3947
return [AVPersistenceUtils avCacheDirectory];
@@ -46,13 +54,6 @@ - (NSString *)diskCachePath {
4654
return _diskCachePath;
4755
}
4856

49-
- (dispatch_queue_t)cacheQueue {
50-
if (!_cacheQueue) {
51-
_cacheQueue = dispatch_queue_create("avos.paas.cacheQueue", DISPATCH_QUEUE_SERIAL);
52-
}
53-
return _cacheQueue;
54-
}
55-
5657
- (NSString *)pathForKey:(NSString *)key {
5758
return [self.diskCachePath stringByAppendingPathComponent:key];
5859
}

0 commit comments

Comments
 (0)