Skip to content

Commit

Permalink
disable schedule before removing
Browse files Browse the repository at this point in the history
  • Loading branch information
Son Roy Almerol committed Nov 19, 2024
1 parent 8259249 commit 16d3c91
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/store/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ func (store *Store) SetSchedule(job Job) error {
fullTimerPath := filepath.Join(TimerBasePath, timerPath)

if job.Schedule == "" {
cmd := exec.Command("/usr/bin/systemctl", "disable", "--now", timerPath)
cmd.Env = os.Environ()
_ = cmd.Run()

_ = os.Remove(fullSvcPath)
_ = os.Remove(fullTimerPath)
} else {
Expand Down

0 comments on commit 16d3c91

Please sign in to comment.