Created
August 29, 2020 14:24
-
-
Save florianbepunkt/fc93c952b4dea80694646f57f12f01fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports.hello = async (event) => { | |
process.env.PATH = `${process.env.PATH}:${process.env.LAMBDA_TASK_ROOT}/bin`; | |
const child = spawn("mongocryptd", [ | |
"--idleShutdownTimeoutSecs=60", | |
]); | |
child.on("error", (error) => console.log(error)); | |
child.stdout.on("data", (data) => { | |
console.log(data.toString()); | |
}); | |
child.stderr.on("data", (data) => { | |
console.error(`grep stderr: ${data}`); | |
}); | |
child.unref(); | |
await new Promise((resolve, reject) => | |
setTimeout(() => { | |
resolve(); | |
}, 3000) | |
); | |
return { | |
statusCode: 200, | |
body: JSON.stringify(resp), | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment