Ultimate Cron

My second month at MD Systems has come to an end so it’s time for my second blog post.

Just like my first month the second month has been a very exciting one, it is really amazing how much I’ve learned and experienced the last couple of weeks that it’s difficult to look back and pick a good topic to write about in my blog. But I have to settle the matter and therefore I’d like to write about my progress on porting Ultimate Cron to Drupal 8.

This blogpost is part of the on-going MD Systems Drupal 8 Internships. In these Blogs the students report monthly about their experience with Drupal 8, the development work they do and the cooperation with our Team…

What is Ultimate Cron?

There is Cron, a standard Drupal core feature. Cron is essentially a collection of jobs that are run on a specific schedule. Every job has it’s own task for example deleting temporary files, checking for available module updates and indexing new content. In Drupal Core, you can only set a single schedule for cron jobs. For example every hour, day or week. This is very limited. As you can imagine there could be situations where you’d like to run specific tasks more often than others. For example indexing content for on-site search results is necessary every 15 minutes if you have a website which regularly updates content. But update-checks for modules are not needed every 15 minutes but for example every week. And that is where Ultimate Cron comes in handy. The main purpose of Ultimate Cron is to allow you to schedule specific Cron tasks on a specific schedule separately and by doing so it allows you to reduce the load on the server. Ultimate Cron Screenshot of Ultimate Cron edit job page in Drupal 8

Working on Ultimate Cron

For the last two weeks I’ve been working on porting Ultimate Cron to Drupal 8. It’s quite a bit of work to get Ultimate Cron working for Drupal 8 as the Drupal 7 version was integrating Chaos tool suite (ctools), which primarily is a set of APIs and tools to improve the developers experience. For example, it was used to manage plugins in the Drupal 7 version of Ultimate Cron.

As functionality of ctools is partly integrated in Drupal 8 core now there has to be a lot of code changes. This adds some difficulty but I must say that the integrated Plugin API in Drupal 8 works really well. In Drupal 7 defining a plugin interface would require you to implement various hooks. Drupal 8 is trying to avoid hooks as much as possible and now ctools is partly integrated in Drupal 8 they replaced implementing hooks with creating a class with the correct implementations and annotation. For a working example check out issue #1704454 on Drupal.org.

Expectations Ultimate Cron

Right now I’m still working on Ultimate Cron and it’s hard for me to set an estimated time of delivery. But what I would like to see is that somewhere next week I’ll have most functionalities covered. Optimizing further would probably take a lot more time but this is not my priority. If you wanna keep updated with my progress I’d suggest you to check the issue that is on Drupal.org or maybe even try out Ultimate Cron for Drupal 8 from the GitHub repository.

DUG September Meeting

Another awesome event this month that I just could not skip for this blog was the Drupal User Group Meeting @Amazee Labs. There were some cool speakers including Arild Matsson my fellow trainee who talked about diving into Drupal 8 development. You can read more about his presentation on his next blog. Jerome recently posted a more detailed blog post about the DUG September Meeting. That was it for now, I’ll publish a new blog post next month. Meanwhile you can find my activity on Drupal.org.

Blog source: md-systems.ch