Fixed memory leak and made response instant
This commit is contained in:
parent
3ee53b7ad1
commit
c59d47326d
3 changed files with 12 additions and 4 deletions
|
|
@ -27,12 +27,12 @@ func HandleMessage(c *gin.Context) {
|
|||
case "confirmation":
|
||||
handleConfirmation(c, &req)
|
||||
case "message_new":
|
||||
handleSearch(c, &req)
|
||||
go handleSearch(c, &req)
|
||||
c.String(http.StatusOK, "ok")
|
||||
}
|
||||
}
|
||||
|
||||
func handleSearch(c *gin.Context, req *MessageRequest) {
|
||||
defer c.String(http.StatusOK, "ok")
|
||||
cardName, err := getCardNameByCommand(req.Object.Body)
|
||||
if err != nil {
|
||||
Message(req.Object.UserId, "Некорректная команда")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue