runner.go: Don't decode if nothing has been added to the batch
If nothing has been added to a batch then decoding will fail if attempted. This can happen, for example, if the run loop is woken up but we realize that we have the generation limit.
This commit is contained in:
parent
8aa97b5e83
commit
5a441d227a
@ -184,6 +184,10 @@ func (s *Server) run(ctx context.Context) {
|
||||
seq.iBatch = batch.NumTokens() - 1
|
||||
}
|
||||
|
||||
if batch.NumTokens() == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
err := s.lc.Decode(batch)
|
||||
if err != nil {
|
||||
slog.Error("failed to decode batch", "error", err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user