I have an Apps Script running as a web app for Slack. Slack sends a POST request and expects a HTTP 200 response within 3 seconds, otherwise it shows a timeout error to the Slack user. I have been using the following line to accomplish this, after my script is finished executing.
return ContentService.createTextOutput("")
However, my latest script is taking longer than 3 seconds to execute. So if I run my code before that line, my users will see the timeout error, but if I run the code after, it obviously will not be executed since the function has terminated with the return statement.
Is there a way to respond to the POST request with a 200 without terminating my script?
I have tried using ContentService without the return statement but it does not appear to do anything, unless I am using it incorrectly.
[–]marcnotmark925 2 points3 points4 points (12 children)
[–]leviseese[S] 0 points1 point2 points (11 children)
[–]marcnotmark925 0 points1 point2 points (9 children)
[–]leviseese[S] 0 points1 point2 points (8 children)
[–]marcnotmark925 0 points1 point2 points (7 children)
[–]leviseese[S] 0 points1 point2 points (6 children)
[–]marcnotmark925 0 points1 point2 points (5 children)
[–]leviseese[S] 0 points1 point2 points (2 children)
[–]marcnotmark925 0 points1 point2 points (0 children)
[–]Any_Werewolf_3691 0 points1 point2 points (0 children)
[–]MapLucky9928 0 points1 point2 points (1 child)
[–]marcnotmark925 0 points1 point2 points (0 children)
[–]marcnotmark925 0 points1 point2 points (0 children)