chef-chruby icon indicating copy to clipboard operation
chef-chruby copied to clipboard

Only set up chruby if the shell is bash or zsh

Open smacfarlane opened this issue 11 years ago • 3 comments

This fixes desktop logins on Ubuntu 13.10, described in https://github.com/postmodern/chruby/issues/56

smacfarlane avatar Nov 08 '13 20:11 smacfarlane

We are getting this issue as well. Exactly.

phillipbroberts avatar Jun 15 '21 14:06 phillipbroberts

From what I can see the only thing that is calling aws from createIssues.js seems to be createIssue() which calls processImages() which uploads images to s3. Maybe there are too many images in the issue body processImages(issue.body) and you are hitting the rate limit for aws calls or s3 uploads.

Maybe try to change Promise.all in the function below into something like bluebird Promise.mapSeries or a native sequential implementation, and add a delay/sleep after each execution.

// processImages.js
const processImages = async (content) => {
  const imgRegExp = /!\[([^\]]+)\]\(([^\)]+)\)/
  const imgMatchAll = new RegExp(imgRegExp, 'g')

  if (config.s3Bucket) {
    return Promise.all(
      (content.match(imgMatchAll) || [])
        .map(img => {
          const [_, title, oldUrl] = img.match(imgRegExp)
          return request({
            method: 'GET',
            encoding: null, // force a buffer
            url: oldUrl,
            transform: (body, response) => ({
              headers: response.headers,
              body,
            })
          })
            // .then(console.log)
            // .then(() => { process.exit(1) })
            .then(response => uploadImage(config.s3Bucket, response.headers['content-type'])(response.body))
            .then(newUrl => {
              console.log('Uploaded image: ', newUrl)
              return { oldUrl, newUrl }
            })

Maybe that would fix the problem, after all, you managed to run the script for 5 pull requests as you mentioned.

xuatz avatar Jun 24 '21 14:06 xuatz