package searchsvc

import (
	"context"

	"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
	"go.uber.org/zap"
)

func (exec *execCtx) executeLocal(ctx context.Context) {
	ids, err := exec.svc.localStorage.search(ctx, exec)

	if err != nil {
		exec.status = statusUndefined
		exec.err = err

		exec.log.Debug(logs.SearchLocalOperationFailed,
			zap.String("error", err.Error()),
		)

		return
	}

	exec.writeIDList(ids)
}