package scanner

import (
	"context"
	"time"

	"go.uber.org/zap"
)

type Worker struct {
	log *zap.Logger
}

func NewWorker(log *zap.Logger) *Worker {
	return &Worker{log: log}
}

func (w *Worker) Name() string {
	return "library-scanner"
}

func (w *Worker) Start(ctx context.Context) error {
	ticker := time.NewTicker(45 * time.Second)
	defer ticker.Stop()

	for {
		select {
		case <-ctx.Done():
			return nil
		case <-ticker.C:
			w.log.Debug("scanner heartbeat")
		}
	}
}
