Browse Source

don’t inhect stars for now, since we hit rate limiter

//cc @kvz
Artur Paikin 6 years ago
parent
commit
f7ca23eec0
1 changed files with 15 additions and 13 deletions
  1. 15 13
      website/inject.js

+ 15 - 13
website/inject.js

@@ -126,22 +126,24 @@ async function injectBundles () {
   })
 }
 
-async function injectGhStars () {
-  const Octokit = require('@octokit/rest')
-  const octokit = new Octokit()
+// re-enable after rate limiter issue is fixed
+//
+// async function injectGhStars () {
+//   const Octokit = require('@octokit/rest')
+//   const octokit = new Octokit()
 
-  let { headers, data } = await octokit.repos.get({
-    owner: 'transloadit',
-    repo: 'uppy'
-  })
+//   let { headers, data } = await octokit.repos.get({
+//     owner: 'transloadit',
+//     repo: 'uppy'
+//   })
 
-  console.log(`${headers['x-ratelimit-remaining']} requests remaining until we hit GitHub ratelimiter`)
+//   console.log(`${headers['x-ratelimit-remaining']} requests remaining until we hit GitHub ratelimiter`)
 
-  let dstpath = path.join(webRoot, 'themes', 'uppy', 'layout', 'partials', 'generated_stargazers.ejs')
-  fs.writeFileSync(dstpath, data.stargazers_count, 'utf-8')
+//   let dstpath = path.join(webRoot, 'themes', 'uppy', 'layout', 'partials', 'generated_stargazers.ejs')
+//   fs.writeFileSync(dstpath, data.stargazers_count, 'utf-8')
 
-  console.log(`${data.stargazers_count} stargazers written to '${dstpath}'`)
-}
+//   console.log(`${data.stargazers_count} stargazers written to '${dstpath}'`)
+// }
 
 async function injectMarkdown () {
   let sources = {
@@ -179,7 +181,7 @@ async function readConfig () {
 async function inject () {
   const config = await readConfig()
 
-  await injectGhStars()
+  // await injectGhStars()
 
   await injectMarkdown()