rigjs 2.1.26 → 2.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/built/index.js +4 -4
- package/lib/deploy/index.ts +2 -0
- package/lib/publish/index.ts +36 -31
- package/package.json +1 -1
package/lib/deploy/index.ts
CHANGED
package/lib/publish/index.ts
CHANGED
|
@@ -21,40 +21,45 @@ const setRewriteUri = async (
|
|
|
21
21
|
['enhance_break']
|
|
22
22
|
);
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
const configId = rwriteResult?.DomainConfigList.DomainConfigModel[0].ConfigId;
|
|
25
|
+
for (let i = 0; i <= 200; i++) {
|
|
26
|
+
const configInfo = await cdn.describeCdnDomainConfigs(domain, configId);
|
|
27
|
+
if (configInfo.DomainConfigs.DomainConfig[0].Status === 'success') {
|
|
28
|
+
break;
|
|
29
|
+
} else if (configInfo.DomainConfigs.DomainConfig[0].Status === 'failed') {
|
|
30
|
+
throw new Error('cdn rewrite fail');
|
|
31
|
+
}
|
|
32
|
+
if (i === 200) {
|
|
33
|
+
throw new Error('cdn rewrite timeout 10min');
|
|
34
|
+
}
|
|
35
|
+
await delay(3000);
|
|
36
|
+
}
|
|
35
37
|
};
|
|
36
38
|
|
|
37
39
|
const refreshCache = async (urls: string[], cdn: CDN) => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
40
|
+
const refreshResult = await cdn.refreshCache(urls.join('\n'));
|
|
41
|
+
console.log('Please Wait For RefreshCache...');
|
|
42
|
+
for (let i = 0; i <= 200; i++) {
|
|
43
|
+
const desResult = await cdn.describeRefreshTaskById(
|
|
44
|
+
refreshResult.RefreshTaskId
|
|
45
|
+
);
|
|
46
|
+
let successCount = 0;
|
|
47
|
+
for (const item of desResult.Tasks) {
|
|
48
|
+
if (item.Status === 'Complete') {
|
|
49
|
+
successCount++;
|
|
50
|
+
} else if (item.Status === 'Failed') {
|
|
51
|
+
throw new Error('RefreshCache Failed');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (successCount === desResult.Tasks.length) {
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
if (i === 200) {
|
|
58
|
+
throw new Error('refresh cache timeout 10min');
|
|
59
|
+
}
|
|
60
|
+
await delay(3000);
|
|
61
|
+
}
|
|
62
|
+
console.log('RefreshCache Done');
|
|
58
63
|
};
|
|
59
64
|
|
|
60
65
|
export default async (cmd: any) => {
|
package/package.json
CHANGED