|
|
@ -484,19 +484,19 @@ func (s *LogService) EditPost(ctx context.Context, id string, update models.Post |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
|
|
|
|
ctx = s.authService.SpinOffContext(ctx) |
|
|
|
spinOffCtx := s.authService.SpinOffContext(ctx) |
|
|
|
go func() { |
|
|
|
ctx, cancel := context.WithTimeout(ctx, time.Minute*10) |
|
|
|
timeout, cancel := context.WithTimeout(spinOffCtx, time.Minute*10) |
|
|
|
defer cancel() |
|
|
|
|
|
|
|
l, err := s.logs.Find(ctx, post.LogID) |
|
|
|
l, err := s.logs.Find(timeout, post.LogID) |
|
|
|
if err != nil { |
|
|
|
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 { |
|
|
|
log.Printf("Failed to update characters in log %s: %s", l.ID, err) |
|
|
|
} |
|
|
|