@@ -373,7 +373,9 @@ - (void)fetchAsyncABTestWithExperiment:(SensorsABTestExperiment *)experiment {
373373 return ;
374374 }
375375
376- [self .requestManager addRequestTask: requestData experiment: experiment];
376+ if (experiment.modeType == SABFetchABTestModeTypeFast) {
377+ [self .requestManager addRequestTask: requestData experiment: experiment];
378+ }
377379
378380 __weak typeof (self) weakSelf = self;
379381 [self .dataManager asyncFetchAllExperimentWithRequest: requestData completionHandler: ^(SABFetchResultResponse *_Nullable responseData, NSError *_Nullable error) {
@@ -383,6 +385,13 @@ - (void)fetchAsyncABTestWithExperiment:(SensorsABTestExperiment *)experiment {
383385 SABLogError (@" asyncFetchAllExperimentWithRequest failure,error: %@ " , error);
384386 // 请求失败,主线程回调结果
385387 dispatch_async (dispatch_get_main_queue (), ^{
388+
389+ if (experiment.modeType == SABFetchABTestModeTypeAsync) {
390+ experiment.handler (experiment.defaultValue );
391+ return ;
392+ }
393+
394+ // 请求合并,只针对 fast 调用
386395 [strongSelf.requestManager excuteExperimentsWithRequest: requestData completion: ^(SensorsABTestExperiment *obj) {
387396 obj.handler (obj.defaultValue );
388397 }];
@@ -392,10 +401,17 @@ - (void)fetchAsyncABTestWithExperiment:(SensorsABTestExperiment *)experiment {
392401
393402 // 通过请求管理器统一回调试验结果,切到主线程回调结果
394403 dispatch_async (dispatch_get_main_queue (), ^{
404+ if (experiment.modeType == SABFetchABTestModeTypeAsync) {
405+ id cacheValue = [strongSelf fetchCacheABTestWithExperiment: experiment];
406+ experiment.handler (cacheValue ?: experiment.defaultValue );
407+ return ;
408+ }
409+
410+ // 请求合并,只针对 fast 调用
395411 [strongSelf.requestManager excuteExperimentsWithRequest: requestData completion: ^(SensorsABTestExperiment *obj) {
396412 // 获取缓存并触发 $ABTestTrigger 事件
397413 id cacheValue = [strongSelf fetchCacheABTestWithExperiment: obj];
398- obj.handler (cacheValue ? : obj.defaultValue );
414+ obj.handler (cacheValue ?: obj.defaultValue );
399415 }];
400416 });
401417 }];
0 commit comments