mautic / mautic

Mautic: Open Source Marketing Automation Software.
https://www.mautic.org
Other
7.34k stars 2.62k forks source link

mautic conjobs for all tasks - crontab mautic:cron:all #1870

Closed manuelfink closed 6 years ago

manuelfink commented 8 years ago

I'm still not having all crontabs installed and still stumble over once I have forgotten since not all are listed in the docs. eg. console mautic:leadlists:update (even though I don't even know what it does.

One cronjob for all task

Thus I wanted to suggest to make one crontab to execute all cronjobs.

# crontab sample:
MAILTO="mymailadress@example.com"
*/5 * * * * php /path/to/mautic/app/console mautic:cron:all > /dev/null
tomgoldsmith commented 8 years ago

I agree, I think this would be a great idea. One very handy addition would be being able to pass arguments to the script to turn off jobs that people don't want to run.

manuelfink commented 8 years ago

@tomgoldsmith good idea, added it to the description.

jordan8037310 commented 8 years ago

I think an issue with this idea is that if your Mautic DB is large, each individual task needs to be separated so it doesn't exceed PHP max execution time during cron runs.

It would make sense as a basic feature, but since you can't skip the work of creating the cron job in the first place, might as well create them all so you don't get frustrated when, after some growth of your DB, your single cron job starts timing out, emails stop sending, campaigns aren't updated, etc.

magician7 commented 8 years ago

@jordan8037310 in some environment there is no problem with max execution time. For example on my host php (php cli) has no time limit. For me and other people with ability run php cron with no time limit it will be very useful - having cron job run all necessary task. AND of course left options to run task individually.

manuelfink commented 8 years ago

Considerations:

@jordan8037310 @magician7: I'd even go one step further and would considering adding 3 modes

  1. deamon (background worker of a que which finishes tasks as the come)
  2. cronjob all
  3. single cron jobs

Regarding all three the following challenges may be considered:

robwent commented 7 years ago

If it could work in a similar way to something like magento then it could be used for some new features.

EG. You have one cron set to run every minute (Or 5 or whatever), but all commands aren't run by default, the jobs are just added to a queue in the database.

Enabling features in the admin can add the needed crons to the queue and make sure that the new jobs are added as needed. Features that aren't enabled don't get added.

You could specify the intervals for each task in the admin area so they only get added to the queue as needed.

Then new plugins could add their own jobs to the queue without needing their own cron jobs to function.

Different campaigns could be set to update at different times rather than one cron trying to update everything at once.

Issues like this one https://github.com/mautic/mautic/issues/3450 where some campaigns only want to be sent on specific days, could be set up in the admin area without needing to set up specific crons for each campaign in the system.

dbhurley commented 6 years ago

In order to improve engagement and increase visibility to this feature request we are closing this issue on GitHub and recommending all Feature Requests (without code attachment) be placed in the Ideas forum on our community site.

We recommend you post your ideas to Mautic's forum so others can comment on them and help turn your ideas into a proof of concept and eventually an exciting new feature in Mautic.

More information about this move can be found in our blog announcement.