Hey all,
I have a long running server-side request to perform and when done I want to update the frontend page with the results. If I run this routine using a Wix web module, then it will timeout with the message “WebMethod request timed-out after 14 seconds”.
My timing indicates the request typically takes up to a minute to run - it’s a non-trivial operation and the time to run can’t really be shortened.
So I was wondering what approaches are available to handle this in the Wix code ecosystem?
-
Perhaps I could try reimplementing using wix-http-functions instead of a WebMethod - do they have the same timeout limitation? (I couldn’t find a mention of their timeout limits anywhere)
-
I could get an async notification from a websocket when the operation completes - can that be done in Wix? I found that the socket.io npm module is available to install in Wix code, but the following forum discussion suggests that it’s not usable for this: https://www.wix.com/code/home/forum/community-discussion/socket-io-npm-module
-
I could write an old fashioned polling loop that periodically hits the server looking for a result.
Any suggestions or code examples would be welcomed!
Matt