package main

import (
	"context"
	"log"
	"os"
	"os/signal"
	"syscall"
	"weatherstation/internal/radar"
	"weatherstation/internal/server"
)

func main() {
	server.SetupLogger()

	ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
	defer stop()

	// Start radar scheduler with defaults (StoreToDB=true; tile defaults read inside package)
	if err := radar.Start(ctx, radar.Options{StoreToDB: true}); err != nil {
		log.Fatalf("service-radar start error: %v", err)
	}

	// Keep process alive until signal
	<-ctx.Done()
	log.Println("service-radar shutting down")
}
