Skip to content

Commit 8e05e53

Browse files
committed
use env var to check if xray available
1 parent 1bf2029 commit 8e05e53

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ var sharp = require('sharp'),
44
isAnimated = require('animated-gif-detector'),
55
smartcrop = require('smartcrop-sharp');
66

7-
var AWS = AWSXRay.captureAWS(require('aws-sdk'));
7+
let AWS;
8+
if ( process.env.AWS_XRAY_DAEMON_ADDRESS ) {
9+
AWS = AWSXRay.captureAWS(require('aws-sdk'));
10+
} else {
11+
AWS = require('aws-sdk');
12+
}
813

914
var regions = {};
1015

0 commit comments

Comments
 (0)