Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Cloud Function 2nd Gen Nodejs set Timeout

I have a cloud function 2nd Gen using Nodejs that is trigger by HTTP using a Task  after 9 min my cloud function stop working with no error logs, also I have set the timeout configuration to 3600  Memoriy allocated 256 MB CPU 1 and Maximum concurrent  to 4.

this cloud function read a file from cloud storage and insert the data into SQL Cloud PostgreSQL database in the same project 

No sure way not getting the 60 min of timeout 

2 1 203
1 REPLY 1

I have included the "dispatchDeadline" to help me increase the response time 

 

const task: protos.google.cloud.tasks.v2.ITask = {
    httpRequest: {
      httpMethod: protos.google.cloud.tasks.v2.HttpMethod.POST,
      url: url,
      headers: {
        Authorization: idToken.Authorization,
        "Content-Type": "application/json",
      },
      body: Buffer.from(JSON.stringify(data)).toString("base64"),
      oidcToken: {
        serviceAccountEmail: `project-service-account@${project}.iam.gserviceaccount.com`,
      },
    },
    dispatchDeadline: { seconds: 1800 }, // 30 minutes
    scheduleTime: {
      seconds: getScheduleTime(event.fileData.name),
    },
  };
Top Solution Authors