Skip to content

Commit

Permalink
refactor: Returning back to the log library instead of fmt
Browse files Browse the repository at this point in the history
refactor: Renaming the wallhaven_engine.go to wallhaven_service.go as it used to be
fix: Removing SIGKILL since it cannot be traped and adding SIGHUB
  • Loading branch information
Guney Saramali committed Jul 19, 2024
1 parent a05f957 commit 5516719
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/wallSync/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5516719

Please sign in to comment.