@@ -97,6 +97,7 @@ @implementation QNUCQuerySingleFlightValue
97
97
@interface QNAutoZone ()
98
98
99
99
@property (nonatomic , strong )NSArray *ucHosts;
100
+ @property (nonatomic , strong )QNFixedZone *defaultZone;
100
101
@property (nonatomic , strong )NSMutableArray <QNRequestTransaction *> *transactions;
101
102
102
103
@end
@@ -128,6 +129,10 @@ - (instancetype)init{
128
129
return self;
129
130
}
130
131
132
+ - (void )setDefaultZones : (NSArray <QNFixedZone *> *)zones {
133
+ self.defaultZone = [QNFixedZone combineZones: zones];
134
+ }
135
+
131
136
- (QNZonesInfo *)getZonesInfoWithToken : (QNUpToken * _Nullable)token
132
137
actionType : (QNActionType)actionType {
133
138
@@ -196,9 +201,17 @@ - (void)preQuery:(QNUpToken *)token actionType:(QNActionType)actionType on:(QNPr
196
201
if (responseInfo.isConnectionBroken ) {
197
202
ret (kQNNetworkError , responseInfo, metrics);
198
203
} else {
199
- QNZonesInfo *zonesInfo = [[QNFixedZone localsZoneInfo ] getZonesInfoWithToken: token];
200
- if ([zonesInfo isValid ]) {
201
- [[QNAutoZoneCache share ] cache: zonesInfo forKey: cacheKey];
204
+ QNZonesInfo *info = nil ;
205
+ if (self.defaultZone ) {
206
+ QNZonesInfo * infoP = [self .defaultZone getZonesInfoWithToken: token actionType: actionType];
207
+ if (infoP && [infoP isValid ]) {
208
+ [infoP toTemporary ];
209
+ info = infoP;
210
+ }
211
+ }
212
+
213
+ if (info) {
214
+ [[QNAutoZoneCache share ] cache: info forKey: cacheKey];
202
215
ret (0 , responseInfo, metrics);
203
216
} else {
204
217
ret (-1 , responseInfo, metrics);
@@ -213,7 +226,7 @@ - (QNRequestTransaction *)createUploadRequestTransaction:(QNUpToken *)token{
213
226
if (self.ucHosts && self.ucHosts .count > 0 ) {
214
227
hosts = [self .ucHosts copy ];
215
228
} else {
216
- hosts = @[ kQNPreQueryHost02 , kQNPreQueryHost00 , kQNPreQueryHost01 ] ;
229
+ hosts = kQNPreQueryHosts ;
217
230
}
218
231
QNRequestTransaction *transaction = [[QNRequestTransaction alloc ] initWithHosts: hosts
219
232
regionId: QNZoneInfoEmptyRegionId
0 commit comments