1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-11-04 07:13:10 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

add rollout strategy

This commit is contained in:
sunnylqm
2024-09-22 17:53:16 +08:00
parent a40d627edf
commit 34bc16ad70
4 changed files with 93 additions and 2 deletions

View File

@@ -22,6 +22,8 @@ import {
import { CheckResult, ProgressData, PushyTestPayload } from './type';
import { PushyContext } from './context';
import { URL } from 'react-native-url-polyfill';
import { isInRollout } from './isInRollout';
import { log } from './utils';
export const PushyProvider = ({
client,
@@ -165,6 +167,14 @@ export const PushyProvider = ({
if (!info) {
return;
}
const rollout = info.config?.rollout;
if (rollout) {
if (!isInRollout(rollout)) {
log(`not in ${rollout}% rollout, ignored`);
return;
}
log(`in ${rollout}% rollout, continue`);
}
info.description = info.description ?? '';
updateInfoRef.current = info;
setUpdateInfo(info);