1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-12 02:30:41 +09:00

Fix replyId update and add goroutine in handleMessage

This commit is contained in:
mcrakhman 2022-08-05 21:05:47 +02:00 committed by Mikhail Iudin
parent 1c81926f35
commit 1a892b05cf
No known key found for this signature in database
GPG key ID: FAAAA8BAABDFF1C0
8 changed files with 158 additions and 101 deletions

View file

@ -98,7 +98,7 @@ func (s *service) createDocument(w http.ResponseWriter, req *http.Request) {
query = req.URL.Query()
text = query.Get("text")
)
timeoutCtx, cancel := context.WithTimeout(context.Background(), time.Second*5)
timeoutCtx, cancel := context.WithTimeout(context.Background(), time.Second*30)
treeId, err := s.documentService.CreateDocument(timeoutCtx, fmt.Sprintf("created document with id: %s", text))
cancel()
if err != nil {
@ -114,7 +114,7 @@ func (s *service) appendDocument(w http.ResponseWriter, req *http.Request) {
text = query.Get("text")
treeId = query.Get("treeId")
)
timeoutCtx, cancel := context.WithTimeout(context.Background(), time.Second*5)
timeoutCtx, cancel := context.WithTimeout(context.Background(), time.Second*30)
err := s.documentService.UpdateDocument(timeoutCtx, treeId, text)
cancel()
if err != nil {