( ctx context.Context, chat database.Chat, logger slog.Logger, )
| 9769 | } |
| 9770 | |
| 9771 | func (p *Server) clearLastTurnSummaryAsync( |
| 9772 | ctx context.Context, |
| 9773 | chat database.Chat, |
| 9774 | logger slog.Logger, |
| 9775 | ) { |
| 9776 | if !chat.LastTurnSummary.Valid { |
| 9777 | return |
| 9778 | } |
| 9779 | // This helper runs during processChat cleanup, while processChat is |
| 9780 | // still counted in p.inflight. Do not take inflightMu here because |
| 9781 | // drainInflight holds it while waiting. |
| 9782 | p.inflight.Go(func() { |
| 9783 | p.updateLastTurnSummary(context.WithoutCancel(ctx), chat, chat.UpdatedAt, "", logger) |
| 9784 | }) |
| 9785 | } |
| 9786 | |
| 9787 | // updateLastTurnSummary writes the cached sidebar summary for a chat. |
| 9788 | // Callers should pass a detached context because this method is used for |
no test coverage detected