This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-website.git


The following commit(s) were added to refs/heads/master by this push:
     new c5d34f7532c Extending the time between http requests (#552)
c5d34f7532c is described below

commit c5d34f7532cccb9557db5029885e4ac9525fea61
Author: Juntao Zhang <[email protected]>
AuthorDate: Sat Dec 31 23:13:16 2022 +0800

    Extending the time between http requests (#552)
---
 scripts/team.js | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/scripts/team.js b/scripts/team.js
index 8a74e6a9ce1..f827f9d2ca2 100644
--- a/scripts/team.js
+++ b/scripts/team.js
@@ -9,7 +9,8 @@ const docsFile = path.join(__dirname, '../data/docs.yml')
 const teamFile = path.join(__dirname, '../data/team.yml')
 const mergedDataFile = path.join(__dirname, 
'../themes/docsy/static/js/mergedData.js')
 
-const sleep = (ms) => {
+const sleep = (ms = 4 * 1000) => {
+  console.log('waiting...');
   return new Promise(resolve => setTimeout(() => resolve(), ms));
 }
 
@@ -46,7 +47,7 @@ class GenerateTeamYaml {
           promiseList.push(this.getRepoContributors({user, repo, 
extraContributors, list, item}));
           mergedPromiseList.push(this.getMergedData({user, repo}));
         }
-        await sleep(1500)
+        await sleep()
       }
     }
     await Promise.all(promiseList)
@@ -86,7 +87,7 @@ class GenerateTeamYaml {
         } else {
           console.log(`${user}/${repo}/graphs: res.status ${status}!`);
           if (count < NUM) {
-            await sleep(1000)
+            await sleep()
             await getContributionsGraphs()
           }
 
@@ -94,6 +95,7 @@ class GenerateTeamYaml {
       } catch (e) {
         console.log(`${user}/${repo}/`, e);
         if (count < NUM) {
+          await sleep()
           await getContributionsGraphs()
         }
       }
@@ -195,6 +197,8 @@ class GenerateTeamYaml {
     list.push(...data);
     if (data.length === per_page) {
       page++;
+      await sleep()
+      console.log(`/${user}/${repo}/contributors?page=${page}`)
       await this.getRepoContributors({user, repo, extraContributors, page, 
per_page, list, item})
     } else {
       if (extraContributors && extraContributors.length) {

Reply via email to