mirror of
https://codeberg.org/video-prize-ranch/rimgo.git
synced 2025-07-17 16:48:24 +00:00
removed goroutine for processing comments
This commit is contained in:
parent
1e74fe248e
commit
09e51174a0
10
api/user.go
10
api/user.go
@ -134,21 +134,13 @@ func (client *Client) FetchUserComments(username string) ([]Comment, error) {
|
||||
|
||||
data := gjson.Parse(string(body))
|
||||
|
||||
wg := sync.WaitGroup{}
|
||||
comments := make([]Comment, 0)
|
||||
data.Get("data").ForEach(
|
||||
func(key, value gjson.Result) bool {
|
||||
wg.Add(1)
|
||||
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
comments = append(comments, parseComment(value))
|
||||
}()
|
||||
|
||||
comments = append(comments, parseComment(value))
|
||||
return true
|
||||
},
|
||||
)
|
||||
wg.Wait()
|
||||
|
||||
client.Cache.Set(username+"-usercomments", comments, cache.DefaultExpiration)
|
||||
return comments, nil
|
||||
|
Loading…
Reference in New Issue
Block a user