Stop the chat client only after the API has stopped (closes #4)
check / check (push) Successful in 1m14s
check / check (push) Successful in 1m14s
The chat client's context no longer follows the bot's, so a stop no longer sends it SIGTERM while the API is still finishing its requests. The deferred stop in Run, which runs after the API's, stops it instead, so a request in progress at a stop gets its answer rather than a 500. The README says so. The new test runs the whole bot with the test binary itself standing in for simplex-chat on PATH. The stand-in holds its answer to the contacts request until the test has told the bot to stop. Model: opus-5-5
This commit is contained in:
@@ -228,7 +228,7 @@ container.
|
||||
Handlers call the chat client on the request's own goroutine, never on
|
||||
the one that delivers events, which also delivers the chat client's
|
||||
answers. When the bot stops, requests in progress get 5 seconds to
|
||||
finish.
|
||||
finish before the chat client is stopped.
|
||||
- **Replies**: for each text message a contact sends in a direct chat,
|
||||
the bot sends back the result, as a reply quoting the message. Group
|
||||
messages, files and the bot's own messages are ignored.
|
||||
|
||||
Reference in New Issue
Block a user