package downloader

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 "downloader-monitor"
}

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

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