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.
@@ -16,6 +16,8 @@ const traverseFolder = (url: string) => {
16
16
  filesList.push(curPath);
17
17
  }
18
18
  });
19
+ } else {
20
+ throw new Error(`Not Found FilePath: ${url}`);
19
21
  }
20
22
  };
21
23
 
@@ -21,40 +21,45 @@ const setRewriteUri = async (
21
21
  ['enhance_break']
22
22
  );
23
23
 
24
- const configId = rwriteResult?.DomainConfigList.DomainConfigModel[0].ConfigId;
25
- while (true) {
26
- const configInfo = await cdn.describeCdnDomainConfigs(domain, configId);
27
- if (configInfo.DomainConfigs.DomainConfig[0].Status === 'success') {
28
- break;
29
- }
30
- if (configInfo.DomainConfigs.DomainConfig[0].Status === 'failed') {
31
- throw new Error('cdn rewrite fail');
32
- }
33
- await delay(3000);
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
- const refreshResult = await cdn.refreshCache(urls.join('\n'));
39
- console.log('Please Wait For RefreshCache...');
40
- while (true) {
41
- const desResult = await cdn.describeRefreshTaskById(
42
- refreshResult.RefreshTaskId
43
- );
44
- let successCount = 0;
45
- for (const item of desResult.Tasks) {
46
- if (item.Status === 'Complete') {
47
- successCount++;
48
- } else if (item.Status === 'Failed') {
49
- throw new Error('RefreshCache Failed');
50
- }
51
- }
52
- if (successCount === desResult.Tasks.length) {
53
- break;
54
- }
55
- await delay(3000);
56
- }
57
- console.log('RefreshCache Done');
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rigjs",
3
- "version": "2.1.26",
3
+ "version": "2.1.27",
4
4
  "description": "A multi-repos dev tool based on yarn and git.Rig is inspired by cocoapods. Not like those monorepo solutions,rig is a tool for organizing multi-repos.",
5
5
  "keywords": [
6
6
  "modular",