Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set http timeout to 30 mins. #240

Merged
merged 1 commit into from
May 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ var dotenv = require('dotenv');
var ScheduleEvents = require('./schedule_events');

var maxBufferSize = 50 * 1024 * 1024;
aws.config.httpOptions.timeout = 30 * 60 * 1000;

var Lambda = function () {
this.version = packageJson.version;
Expand Down Expand Up @@ -371,7 +372,7 @@ Lambda.prototype._setRunTimeEnvironmentVars = function (program) {
};

Lambda.prototype._uploadExisting = function (lambda, params, cb) {
return lambda.updateFunctionCode({
var request = lambda.updateFunctionCode({
'FunctionName': params.FunctionName,
'ZipFile': params.Code.ZipFile,
'Publish': params.Publish
Expand All @@ -395,12 +396,26 @@ Lambda.prototype._uploadExisting = function (lambda, params, cb) {
return cb(err, data);
});
});

request.on('retry', function (response) {
console.log(response.error.message);
console.log('=> Retrying');
});

return request;
};

Lambda.prototype._uploadNew = function (lambda, params, cb) {
return lambda.createFunction(params, function (err, data) {
var request = lambda.createFunction(params, function (err, data) {
return cb(err, data);
});

request.on('retry', function (response) {
console.log(response.error.message);
console.log('=> Retrying');
});

return request;
};

Lambda.prototype._readArchive = function (program, archive_callback) {
Expand Down