package cleaners

import (
	"time"

	"github.com/rs/zerolog/log"

	"git.mstar.dev/mstar/linstrom/storage-new/dbgen"
)

func init() {
	cleanerBuilders = append(cleanerBuilders, buildGdprUsers)
}

func tickGdprUsers(now time.Time) {
	if err := dbgen.User.GdprUsers(); err != nil {
		log.Error().Err(err).Msg("Failed to gdpr users")
	}
}

func buildGdprUsers() (onTick func(time.Time), name string, tickSpeed time.Duration) {
	return tickGdprUsers, "gdpr-users", time.Hour
}
