Skip to content

Unresponsive after some time #24

@lifeamit

Description

@lifeamit

Hi,

I am running into an issue and seeking some help here. I am able to authenticate successfully and talk to google APIs (calendar v3 apis). But after 2-3 days things stop working. Request to google APIs never finishes and it just keeps waiting.

But if I restart my node server, everything is back to normal and I start getting response from google APIs, but it starts to hang after 2-3 days again (unless I restart my node server).

Any clue on how to fix it ? Does it has to do with token getting expired after few days and somehow restarting the server fixes it ?

Here is the code to talk to google apis:

var googleAuth = require('google-oauth-jwt');
var request = googleAuth.requestWithJWT();
var url = 'https://www.googleapis.com/calendar/v3/calendars/{cal_id}/events';
request({
    url: url,
    jwt: {
        email: '{SERVICE_ACCOUNT_EMAIL}.gserviceaccount.com',
        keyFile: 'google-api-key.pem',
        scopes: ['https://www.googleapis.com/auth/calendar.readonly']
    }
}, function (err, res, body) {
    // Handle response
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions