This is my onAppInstallCallback
onAppInstallCallback: async function (payload) {
try {
const appInstallHandler = new AppInstallHandler();
console.log(
'\n\n================= App install event Called =================\n'
);
await appInstallHandler.installationDebugLogs(payload);
await appInstallHandler.handleCallback(payload);
console.log('App install finished: ', new Date().toString());
renderData();
} catch (error) {
console.log('err====', error);
renderData({ error: error.message });
}
}
And this is await appInstallHandler.handleCallback(payload)
async handleCallback(payload) {
const schedular = new ScheduleHandler();
const storeResponse = await schedular.createSchedule();
this.handleOneTimeSync(payload)
.then(() => {
console.log(`******* Process executed successfully *******`);
})
.catch((error) => console.log('Error: ', error))
.finally(() => console.log('Completed'));
return storeResponse;
}
Here, handleOneTimeSync
will take time to complete its execution which sometimes might be greater than 20 second timeout limit.
Since I am using the then... catch...
block for this method. After scheduling the event, execution will not wait for handlerOneTimeSync
and return a response directly before 20 seconds to the appInstallHandler
and that console.log('App install finished: ', new Date().toString());
also logging and rednerData() will execute.
But since it takes time to complete handleOneTimeSync
at the time of app installation and the App couldn’t be installed and timeout exceeds.
So, If I returned something before the timeout and did not wait for some async method which running using then…catch… , then also is the timeout affect it and the process stops after 20 seconds?
Is there any option that we can increase the timeout limit for some particular event?
Can anyone help me out of this?