4 ms·
The `cmd &&` looks fishy in their example, and would probably have been removed in a review. Instead, one could write : const { ping, curl, ㅤ } = req.query
by lovasoa 5y ago
The `cmd &&` looks fishy in their example, and would probably have been removed in a review. Instead, one could write :
const { ping, curl, ㅤ } = req.query;
const checkCommands = [
ping && 'ping -c 1 google.com',
curl && 'curl -s http://example.com/', ㅤ
];
await Promise.all(checkCommands.map(cmd => cmd && exec(cmd, { timeout: 5_000 })));
This way the `cmd &&` is justified
- testASW2 5y agod