We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents cc99cac + e2bca6d commit f1c69feCopy full SHA for f1c69fe
controllers/scriptStorage.js
@@ -50,14 +50,24 @@ exports.getSource = function (aReq, aCallback) {
50
51
Script.findOne({ installName: caseInsensitive(installName) },
52
function (aErr, aScript) {
53
+ var s3Object = null;
54
+
55
if (!aScript) {
56
return aCallback(null);
57
}
58
59
+ s3Object = s3.getObject({ Bucket: bucketName, Key: installName }).createReadStream().
60
+ on('error', function () {
61
+ if (isPro) {
62
+ console.error('S3 Key Not Found ' + installName);
63
+ }
64
65
+ return aCallback(null);
66
+ });
67
68
// Get the script
- aCallback(aScript, s3.getObject({ Bucket: bucketName, Key: installName })
- .createReadStream());
- });
69
+ aCallback(aScript, s3Object);
70
71
};
72
73
exports.sendScript = function (aReq, aRes, aNext) {
0 commit comments