A while I ago I created a Discourse plugin which calls a controller method via ajax
and then returns the result. This particular request can run for a few minutes, and this was running fine.
But now after a long while I tried the plugin in the current Discourse version and I’m running into an issue where the request is aborted after 1 minute.
So the code looks like this:
ajax("/my-plugin/import", {
type: "POST",
data: {
categoryId: this.categoryId,
otherData: ...
}
}).then((result) => { ... });
And the error message I see after 1 minute is:
Discourse Ember CLI Proxy Error
FetchError: request to http://127.0.0.1:3000/my-plugin/import failed, reason: socket hang up
at ClientRequest. (file:///src/app/assets/javascripts/node_modules/node-fetch/src/index.js:108:11)
at ClientRequest.emit (node:events:526:35)
at Socket.socketOnEnd (node:_http_client:525:9)
at Socket.emit (node:events:526:35)
at endReadableNT (node:internal/streams/readable:1359:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
What I’m trying to understand is why this behaviour might have changed in the past year? And if there is any option to change the timeout setting.