I am making a bot on dialogflow with a webhook. I get an error : DEADLINE_EXCEEDED. My webhook takes a bit over 5 seconds to return a response. Is there a way to allow a longer time than 5 seconds ?
Asked
Active
Viewed 3,258 times
1 Answers
3
This is not possible. One possibility is to (if you have for example a background task which takes some time) is to send back (before the 5 sec timeout) an Event. This triggers again a call to the Webhook, so you get another 5 sec to finish your background process.
-
Won't this make my webhook process start over if it is triggered a second time ? – Emma Vande Wouwer Jan 07 '20 at 09:07
-
3It depends on your code. After the first request you start a background task, with your second request (after the event) you just need to check the status of the background thread (isCompleted flag) and obtain the result. – Beppe C Jan 07 '20 at 09:38
-
@BeppeC Could you elaborate on it by giving a sample code – m b Mar 19 '21 at 06:12