@@ -97,6 +97,7 @@ @implementation QNUCQuerySingleFlightValue
9797@interface QNAutoZone ()
9898
9999@property (nonatomic , strong )NSArray *ucHosts;
100+ @property (nonatomic , strong )QNFixedZone *defaultZone;
100101@property (nonatomic , strong )NSMutableArray <QNRequestTransaction *> *transactions;
101102
102103@end
@@ -128,6 +129,10 @@ - (instancetype)init{
128129 return self;
129130}
130131
132+ - (void )setDefaultZones : (NSArray <QNFixedZone *> *)zones {
133+ self.defaultZone = [QNFixedZone combineZones: zones];
134+ }
135+
131136- (QNZonesInfo *)getZonesInfoWithToken : (QNUpToken * _Nullable)token
132137 actionType : (QNActionType)actionType {
133138
@@ -196,9 +201,17 @@ - (void)preQuery:(QNUpToken *)token actionType:(QNActionType)actionType on:(QNPr
196201 if (responseInfo.isConnectionBroken ) {
197202 ret (kQNNetworkError , responseInfo, metrics);
198203 } 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];
202215 ret (0 , responseInfo, metrics);
203216 } else {
204217 ret (-1 , responseInfo, metrics);
@@ -213,7 +226,7 @@ - (QNRequestTransaction *)createUploadRequestTransaction:(QNUpToken *)token{
213226 if (self.ucHosts && self.ucHosts .count > 0 ) {
214227 hosts = [self .ucHosts copy ];
215228 } else {
216- hosts = @[ kQNPreQueryHost02 , kQNPreQueryHost00 , kQNPreQueryHost01 ] ;
229+ hosts = kQNPreQueryHosts ;
217230 }
218231 QNRequestTransaction *transaction = [[QNRequestTransaction alloc ] initWithHosts: hosts
219232 regionId: QNZoneInfoEmptyRegionId
0 commit comments