diff --git a/cmd/wallSync/main.go b/cmd/wallSync/main.go index 70d5117..c60abbd 100644 --- a/cmd/wallSync/main.go +++ b/cmd/wallSync/main.go @@ -54,7 +54,7 @@ func main() { externalService := initService(serviceArgs, args, imageUpdateChannel, imageCache) backgroundImagecService := services.NewBackgroundImageService(args, imageUpdateChannel, imageCache) - ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGKILL) + ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGHUP) defer stop() go backgroundImagecService.Listen() diff --git a/internal/services/walhaven_engine.go b/internal/services/walhaven_service.go similarity index 98% rename from internal/services/walhaven_engine.go rename to internal/services/walhaven_service.go index 82894a9..2f95248 100644 --- a/internal/services/walhaven_engine.go +++ b/internal/services/walhaven_service.go @@ -120,7 +120,7 @@ func (w *WallHavenService) getMetaData() error { func (w WallHavenService) getRandomImage() (models.WallHavenData, error) { log.Println("Downloading image") var newArgs *models.WallhavenArgs = w.args - newArgs.Page = rand.IntN(w.metaData.LastPage-1) + 1 + newArgs.Page = rand.IntN(w.metaData.LastPage) response, err := w.requestEngine.DoRequest(http.MethodGet, utils.CreateUrlQuery(newArgs)) if err != nil { return models.WallHavenData{}, err