cron.go: disabling crons from crons page doesn't appear to do anything
Issue #177
resolved
Only getting this when we disable:
2022-05-23 06:53:01 default[7] 2022/05/23 06:53:01 setting cron: SensorPiOn
2022-05-23 06:53:01 default[7] 2022/05/23 06:53:01 cron: SensorPiOn with this spec, already exists, doing nothing
Comments (3)
-
reporter -
reporter After further exploration it turns out an accidental regression was caused with this commit with removal of the isSameCron function which actually did do a proper check of the cron :/.
-
reporter - changed status to resolved
cron.go: fixing regression; resolves issue
#177→ <<cset efe950563456>>
- Log in to comment
The culprit appears to be the check on line 8-9 below. This seems to check whether the state of the cron has changed or not, however this check is limited to the TOD, which wouldn’t detect a change in the Enabled field (among others). We should probably create a helper function that does a more extensive check on the job fields and returns a boolean to indicate whether it’s the same cron or not.