mirror of
https://github.com/go-shiori/shiori.git
synced 2025-09-07 05:24:54 +08:00
fix: failed to save bookmark: context canceled (#499)
When the HTTP request completes, the asynchronous bookmarks save may be incomplete.
In this case, the shared context is canceled and saving bookmarks fails.
Introduced by 09f2465065
This commit is contained in:
parent
222fc14fe2
commit
040dc5c5d1
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
package webserver
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
|
@ -326,7 +327,7 @@ func (h *handler) apiInsertBookmark(w http.ResponseWriter, r *http.Request, ps h
|
|||
if err != nil {
|
||||
log.Printf("error downloading boorkmark: %s", err)
|
||||
}
|
||||
if _, err := h.DB.SaveBookmarks(ctx, *bookmark); err != nil {
|
||||
if _, err := h.DB.SaveBookmarks(context.Background(), *bookmark); err != nil {
|
||||
log.Printf("failed to save bookmark: %s", err)
|
||||
}
|
||||
}()
|
||||
|
|
Loading…
Add table
Reference in a new issue