Skip to content

Commit 8df4a50

Browse files
author
deathowl
committed
restructure code.
1 parent f73786f commit 8df4a50

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/errorparser.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ ErrorParser.prototype = {
4747
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
4848
}
4949

50-
51-
var req = http.request( postRequest, function( res ) {
50+
if((Date.now() - except.createdat) / 1000 > 60) {
51+
var req = http.request( postRequest, function( res ) {
5252

5353
res.statusCode;
5454
var buffer = "";
@@ -63,14 +63,15 @@ ErrorParser.prototype = {
6363
}
6464
} );
6565

66-
});
67-
if((Date.now() - except.completedAt) / 1000 > 60) {
66+
});
67+
6868
req.write(except.data);
69-
} else {
69+
70+
req.end();
71+
} else {
7072
that.logger.log("exception too old, ignoring.");
7173
that.statsdClient.increment("errbit.proxy.delivery.ignore");
7274
}
73-
req.end();
7475
}
7576
};
7677

0 commit comments

Comments
 (0)