wanasit / google-calendar

Google Calendar API connection in Node.js
MIT License
230 stars 54 forks source link

How to change the timeout from 10 sec to 60 sec? #17

Open josdejong opened 9 years ago

josdejong commented 9 years ago

Creating a new calendar regularly takes more than 10 seconds, resulting in a timeout. The needle library used has a default timeout of 10 seconds, but I if I see it correctly there is no way to pass a timeout to needle via google-calendar: the 4th argument options of the request is always an empty object {}.

Calendars.prototype.insert = function(calendar, option, callback) {
  if(!callback){ callback = option; option = {}; }
  this.request('POST', '/calendars',  option, {}, calendar, callback);
}

https://github.com/wanasit/google-calendar/blob/master/GoogleCalendar.js#L156

It would be great to have an option to apply an other timeout, either globally or per request.