Client disconnections
it seems like a lot of clients are being disconnected. how can i debug / be able to properly handle that? can i respond with something right before its disconnected?
1 Reply
If a client is disconnected there isn't any time to reply. This will happen, for example, if you make a request via
cURL
and then hit Control C in the middle of the request - since the request immediately exits the server doesn't have any chance to reply.
As for other clean-up work, you can try using waitUntil https://developers.cloudflare.com/workers/runtime-apis/fetch-event/#waituntil, which I think still runs even if the client disconnects (although I'm not certain about that).