The Cron Service module extends the current cron system and allows a developer to write code for executing by cron in services instead of using hooks. It also provides simplified control for the developer on when the code should be executed.

On every cron run, it looks for services tagged by 'cron_service', make additional checks if needed (depends on interfaces implemented by service class) and executes their execute() method.

The module does not have any UI and does not write anything to config or database.

Project link

https://www.drupal.org/project/cron_service

Git instructions

git clone --branch 8.x-1.x https://git.drupal.org/project/cron_service.git

PAReview checklist

https://pareview.sh/pareview/https-git.drupal.org-project-cron_service.git

Comments

jureth created an issue. See original summary.

avpaderno’s picture

Issue summary: View changes

Thank you for your contribution! I added the PAReview checklist. Reviewers will soon check the code and report here what they found out.

If you still haven't done it, please check what reported from the PAReview checklist. There could be some false positives; be careful of not changing code that should not be.

klausi’s picture

Status: Needs review » Reviewed & tested by the community

"$this->log->info('Start executing ' . $id);": do not concatenate variables to log messages, use placeholder instead. Please check all your log calls. Also don't use sprintf() for log messages. The problem with that is that on display of log messages they are run through t(). Each log message is different with variables, which will then fill up your localization table quickly with useless translation strings.

Otherwise looks good to me!

jureth’s picture

Added t() calls for logs.
Updated readme.md and added hook_help() however it doesn't have any code because there're no routes to show the help on.

Everything is in 8.x-1.x-dev version now.

avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Reviewed & tested by the community » Fixed

I am going to update your account.

These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank all the dedicated reviewers as well.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.