Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Add the ability to set a timeout for push #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fbyrne
Copy link

@fbyrne fbyrne commented Feb 11, 2021

Hi,

Our package builder jobs ran into a timeout issue pushing a large package >2gb which was failing due to a POST request timeout.

var octo = require('@octopusdeploy/octopackjs');

octo.push('./bin/Sample.Web.3.2.1.tar.gz', {
        host: 'http://octopus-server/', 
        apikey: 'API-XXXXXXXXX',
        replace: true
    }, function(err, result) {
     if(!err) {
        console.log("Package Pushed:" + body.Title + " v"+ body.Version +" (" + fileSizeString(body.PackageSizeBytes) +"nytes)"); 
     }
});

Error received:

Pushing to: 'https://octopus-server/api/packages/raw' with timeout 120000ms
--
Push response: 408
error pushing to octo!
{
"statusCode": 408,
"statusMessage": "REQUEST_TIMEOUT",
"response": {
   "statusCode": 408,
   "headers": {
   "content-length": "0",
   "connection": "Close",
   ...
}
}

New Feature allows:

var octo = require('@octopusdeploy/octopackjs');

octo.push('./bin/Sample.Web.3.2.1.tar.gz', {
        host: 'http://octopus-server/', 
        apikey: 'API-XXXXXXXXX',
        replace: true,
        timeout: 120000,
    }, function(err, result) {
     if(!err) {
        console.log("Package Pushed:" + body.Title + " v"+ body.Version +" (" + fileSizeString(body.PackageSizeBytes) +"nytes)"); 
     }
});

I am submitting this PR to add a timeout option into the push function.

Let me know if its ok to merge or if you need any changes.

Kind regards,
Fergus

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Fergus Byrne seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants