You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
/**
Triggered from a change to a Cloud Storage bucket.
@param {!Object} event Event payload and metadata.
@param {!Function} callback Callback function to signal completion.
*/
const storage = require("@google-cloud/storage")();
const curl = new(require('curl-request'))();
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
/**
*/
const storage = require("@google-cloud/storage")();
const curl = new(require('curl-request'))();
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();
};
The text was updated successfully, but these errors were encountered: