Olx added preflight check of available concurrent req.
This commit is contained in:
19
test/scraperAPITest.js
Normal file
19
test/scraperAPITest.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { SCRAPER_API_KEY } = require("../app/config/appConfig");
|
||||
|
||||
const scraperapiClient = require("scraperapi-sdk")(SCRAPER_API_KEY);
|
||||
|
||||
async function logUsedConcurrentReq() {
|
||||
try {
|
||||
const response = await scraperapiClient.account();
|
||||
const dateOfLog = new Date().toLocaleString();
|
||||
console.log(
|
||||
dateOfLog,
|
||||
" Number of concurrent requests: ",
|
||||
response.concurrentRequests
|
||||
);
|
||||
} catch (err) {
|
||||
console.log(err.message);
|
||||
}
|
||||
}
|
||||
|
||||
setInterval(logUsedConcurrentReq, 1000);
|
||||
Reference in New Issue
Block a user