Skip to content

Commit

Permalink
Make timeout configurable, mention in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
felixge committed Jul 20, 2011
1 parent 04c20a9 commit 66d08e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ This screenshot shows an airbrake error send from this module:
* Support for [long-stack-traces][]
* Optional auto-handler for `uncaughtException` events
* Provides notification url linking to airbrake in `notify()` callback
* Timeout airbrake requests after 30 seconds, you never know

[long-stack-traces]: https://github.com/tlrobinson/long-stack-traces

Expand Down Expand Up @@ -144,6 +145,10 @@ The version of this app. Set to a semantic version number, or leave unset.

The protocol to use.

### airbrake.timeout = 30 * 1000

The timeout after which to give up trying to notify airbrake in ms.

### airbrake.handleExceptions()

Registers a `process.on('uncaughtException')` listener. When an uncaught
Expand Down
3 changes: 2 additions & 1 deletion lib/airbrake.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function Airbrake() {
this.env = process.env.NODE_ENV;
this.projectRoot = null;
this.appVersion = null;
this.timeout = 30 * 1000;

// Disabled, see comments in appendServerEnvironmentXml()
// this.hostname = os.hostname();
Expand Down Expand Up @@ -65,7 +66,7 @@ Airbrake.prototype.notify = function(err, cb) {
method: 'POST',
url: this.url('/notifier_api/v2/notices'),
body: body,
timeout: 30 * 1000,
timeout: this.timeout,
headers: {
'Content-Length': body.length,
'Content-Type': 'text/xml',
Expand Down

0 comments on commit 66d08e8

Please sign in to comment.