jamesrwhite / minicron

🕰️ Monitor your cron jobs
GNU General Public License v3.0
2.34k stars 154 forks source link

Allow one job to belong to multiple hosts #242

Closed samueliitg closed 7 years ago

samueliitg commented 8 years ago

I have configured 2 hosts and some jobs on minicron. However, for the second host I configured, whenever I run the cron for the first time, it's creating a new job with given command as it's name, on which the count is getting updated, and a new host. Please find attached screenshots

These are the hosts I configured.. I only did s1, but a duplicate got created. image

And in the jobs, I only created prod_difference_alert, but it created a new job with the command as it's name and count of executions as 1. image

I have minicron service running on both the machines, with common db.

raphaelvigee commented 7 years ago

I'm having the same issue, if the name does not match the command being ran, it creates a new one and increment the execution of this new one

jamesrwhite commented 7 years ago

This is a current limitation, the uniqueness of a job is determined by a hash of the job command and the hostname of the server it runs on. As such the same job running on two different servers will show up differently as a job belongs to one host exactly in minicron's data model.

In the next release I've been considering altering this so the same job can belong to multiple hosts.

raphaelvigee commented 7 years ago

Yeah I got that, but it seems that while importing existing tasks the hashes are not creating properly, resulting in a duplicate and then errors (because of the duplicate command in the BD) when running the task for the first time.

jamesrwhite commented 7 years ago

This will be fixed in 1.0 🎉