Don't return an error when tracker is closed

If we return an error here it bubbles up to the engine and causes the query to be marked as failed.
That's misleading and will cause errors in logs on normal shutdown.
It's better to simply do nothing when tracker is closed.

Signed-off-by: Lukasz Mierzwa <l.mierzwa@gmail.com>
This commit is contained in:
Lukasz Mierzwa 2024-12-11 17:07:18 +00:00
parent 5642fac9fd
commit 20a47d8016

View file

@ -220,7 +220,7 @@ func (tracker ActiveQueryTracker) Delete(insertIndex int) {
func (tracker ActiveQueryTracker) Insert(ctx context.Context, query string) (int, error) {
if !tracker.isRunning.Load() {
return 0, errors.New("ActiveQueryTracker is stopped")
return 0, nil
}
select {
case i := <-tracker.getNextIndex: