mirror of
https://github.com/go-shiori/shiori.git
synced 2025-02-21 14:33:19 +08:00
Fix wrong mutex
This commit is contained in:
parent
dd2c302153
commit
124c2845e9
1 changed files with 3 additions and 3 deletions
|
@ -81,6 +81,7 @@ func init() {
|
|||
}
|
||||
|
||||
func updateBookmarks(indices []string, url, title, excerpt string, tags []string, offline bool) ([]model.Bookmark, error) {
|
||||
mutex := sync.Mutex{}
|
||||
// Read bookmarks from database
|
||||
bookmarks, err := DB.GetBookmarks(db.GetBookmarksOptions{WithContents: true}, indices...)
|
||||
if err != nil {
|
||||
|
@ -97,12 +98,11 @@ func updateBookmarks(indices []string, url, title, excerpt string, tags []string
|
|||
|
||||
// If not offline, fetch articles from internet
|
||||
if !offline {
|
||||
mutex := sync.Mutex{}
|
||||
waitGroup := sync.WaitGroup{}
|
||||
|
||||
for i, book := range bookmarks {
|
||||
waitGroup.Add(1)
|
||||
|
||||
go func(pos int, book model.Bookmark) {
|
||||
waitGroup.Add(1)
|
||||
defer waitGroup.Done()
|
||||
|
||||
article, err := readability.Parse(book.URL, 10*time.Second)
|
||||
|
|
Loading…
Reference in a new issue