mirror of
https://github.com/Lissy93/web-check.git
synced 2025-02-09 23:20:37 +01:00
Skip check if no data returned from host
This commit is contained in:
parent
7422d22538
commit
e3541679c2
@ -41,6 +41,13 @@ exports.handler = async (event, context) => {
|
||||
}).on('error', reject);
|
||||
});
|
||||
|
||||
if (!carbonData.statistics || (carbonData.statistics.adjustedBytes === 0 && carbonData.statistics.energy === 0)) {
|
||||
return {
|
||||
statusCode: 200,
|
||||
body: JSON.stringify({ skipped: 'Not enough info to get carbon data' }),
|
||||
};
|
||||
}
|
||||
|
||||
carbonData.scanUrl = url;
|
||||
return {
|
||||
statusCode: 200,
|
||||
|
Loading…
Reference in New Issue
Block a user