Browse Source

try fix again again again.

master
Gisle Aune 3 years ago
parent
commit
928e643ab7
  1. 10
      services/logs.go

10
services/logs.go

@ -484,19 +484,19 @@ func (s *LogService) EditPost(ctx context.Context, id string, update models.Post
return nil, err return nil, err
} }
ctx = s.authService.SpinOffContext(ctx)
spinOffCtx := s.authService.SpinOffContext(ctx)
go func() { go func() {
ctx, cancel := context.WithTimeout(ctx, time.Minute*10)
timeout, cancel := context.WithTimeout(spinOffCtx, time.Minute*10)
defer cancel() defer cancel()
l, err := s.logs.Find(ctx, post.LogID)
l, err := s.logs.Find(timeout, post.LogID)
if err != nil { if err != nil {
return return
} }
s.changeService.Submit(ctx, models.ChangeModelPost, "edit", true, changekeys.Many(l, post), post)
s.changeService.Submit(timeout, models.ChangeModelPost, "edit", true, changekeys.Many(l, post), post)
_, err = s.refreshLogCharacters(ctx, *l, nil, false)
_, err = s.refreshLogCharacters(timeout, *l, nil, false)
if err != nil { if err != nil {
log.Printf("Failed to update characters in log %s: %s", l.ID, err) log.Printf("Failed to update characters in log %s: %s", l.ID, err)
} }

Loading…
Cancel
Save