Open wahyuandi840 opened 5 years ago
Getting the same issue. I think you can only run 1 task at once.
Just do a new (require( 'curl-request' ))()
each time to avoid this
const CurlRequest = require('curl-request'); sites.forEach(site => { console.log(site); const curl = new CurlRequest; curl.get('https://' + site).then(...); });
i have error in google cloud function. Error: Handle already running! at Error (native) at Curl.perform (/user_code/node_modules/curl-request/node_modules/node-libcurl/lib/Curl.js:1051:11) at e (/user_code/node_modules/curl-request/index.js:169:27) at _submit (/user_code/node_modules/curl-request/index.js:141:16) at post (/user_code/node_modules/curl-request/index.js:93:21) at /user_code/index.js:112:9 at f (/user_code/node_modules/@google-cloud/storage/node_modules/once/once.js:25:25) at ConcatStream. (/user_code/node_modules/@google-cloud/storage/node_modules/concat-stream/index.js:37:43) at emitNone (events.js:91:20) at ConcatStream.emit (events.js:185:7)
my code is /**
exports.getEmail = (event, callback) => { const file = event.data; const eventAge = Date.now() - Date.parse(event.timestamp); const eventMaxAge = 10000;
// Ignore events that are too old if (eventAge > eventMaxAge) { console.log(
Dropping event ${event} with age ${eventAge} ms.
); callback(); return; }//console.log(
Event: ${event.eventId}
); //console.log(Event Type: ${event.eventType}
); //console.log(Bucket: ${file.bucket}
); // console.log(File: ${file.name}
); //console.log(Metageneration: ${file.metageneration}
); //console.log(Created: ${file.timeCreated}
); //console.log(Updated: ${file.updated}
);if (file.name.match('registerfolder/')) { storage. bucket(file.bucket). file(file.name). download(function(err, contents) { var obj = JSON.parse(contents.toString());
} callback(); };