Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Every Minute event #1260

Closed
angrybrad opened this issue Jan 31, 2017 · 8 comments
Closed

Every Minute event #1260

angrybrad opened this issue Jan 31, 2017 · 8 comments
Labels
enhancement improvements to existing features extensibility 🔌 features related to plugin/module dev

Comments

@angrybrad
Copy link
Member

Created by: Christian ([email protected]) on 2015/03/09 00:49:13 +0000
Votes at time of UserVoice import: 1


It would be great it there was an event that Craft triggers every minute. The dev sets up a cron that calls a controller action to make this possible, and would then be able to do all kind of cool things when listening to that event.

craft()->on('global.everyMinute', function(Event $event) {
$interval = $event->params['interval'];

if (in_array(5, $interval)) { 
    // cool things every 5 minutes :) 
}

});

@carlcs
Copy link
Contributor

carlcs commented Mar 23, 2017

Issue can be closed.
@joshangell just released https://github.com/supercool/Scheduler, which does all I wanted and more.

@sjelfull
Copy link
Contributor

I don't think it should be closed. Ideally, I think it should be even more like Laravel Scheduler.

More flexibility, repeating jobs, etc.
Josh's Scheduler is more for one-off jobs.

@joshangell
Copy link
Contributor

joshangell commented Mar 23, 2017 via email

@angrybrad
Copy link
Member Author

Going to leave it open, because we definitely have plans of doing something like this in core.

@angrybrad
Copy link
Member Author

Great job on the plugin, @joshangell!

@sjelfull
Copy link
Contributor

sjelfull commented Mar 23, 2017

I like how Laravel Scheduler allow you to both run console commands, closures and Command classes, as well as it's descriptive, chainable way of defining jobs.

Would be a ideal inspiration source for how this could work in the core.

@sjelfull
Copy link
Contributor

I found https://github.com/omnilight/yii2-scheduling today. Looks like a good base to use for adding this.

@brandonkelly brandonkelly added the system administration 💼 features related to system administration label Feb 25, 2018
@brandonkelly brandonkelly added enhancement improvements to existing features and removed feature labels Mar 5, 2019
@brandonkelly brandonkelly added this to the 4.0 milestone Nov 6, 2019
@brandonkelly brandonkelly added extensibility 🔌 features related to plugin/module dev and removed system administration 💼 features related to system administration labels Nov 6, 2019
@brandonkelly
Copy link
Member

We’re using that omnilight/yii2-scheduling package in Craftnet. Works well!

@craftcms craftcms locked and limited conversation to collaborators Jul 13, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement improvements to existing features extensibility 🔌 features related to plugin/module dev
Projects
None yet
Development

No branches or pull requests

5 participants