Giter VIP home page Giter VIP logo

cronmanager's Introduction

Hi, I’m Thomas Jakobi 👋

I am a german web-developer & designer based in Münsterland, Germany. I am the developer and/or maintainer of around 35 open source extras for MODX. I am the owner of Treehill Studio, an agency developing premium extras for MODX.

Open Source

I love open source and I commit some of my spare time in open source projects. Most of these projects are extensions to MODX, a content management system to build fast, secure websites.

If you like my work, you can sponsor me on GitHub Sponsors. You can also buy me a coffee (or two) on Ko-fi. I also offer paid coding of custom MODX extras.

Thomas's GitHub stats

Current work

My last open source extra for MODX was TwoFactorX, a MODX extra that adds a two-factor authentication to the MODX manager. Behind the curtain I am working on Cursus, a premium booking system for MODX on base of Agenda.

cronmanager's People

Contributors

dependabot[bot] avatar jako avatar rtripault avatar weblate avatar wfoojjaec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cronmanager's Issues

Updating cronjobs from grid throws an error

While attempting to update cronjobs from the grid, an error is thrown: Requested processor not found.
The processor getting called is (mgr/cronjobs/updateFromGrid) .

Reproduced on MODX 3.0.4-pl.

Errors after update to 1.2.0-pl2

I updated the component to version 1.2.0-pl2, I can not add snippets, and errors (below) are written to the log on the component page.

Error 42S22 executing statement: 
Array
(
    [0] => 42S22
    [1] => 1054
    [2] => Unknown column 'snippet.name' in 'order clause'
)
``

MODx 2.7.1
PHP 7.2

Feature Request - edit the next run date

Thanks for cronmanager! It works great.

I would like to request the ability to edit the next run date/time. I have some that run every 24 hours and I want them to run early morning. I had a snippet with a fatal error in it which caused cron not to finish and once I found it out and fixed it was daytime and then set the next time to 24hrs from now which was day time. I manual edited the db table but it would be great if I could just set the next time via the manager.

Thanks,

Make cronjob GRid sortable

Clicking the columns doesn't change the sortorder.

This is important if you have multiple cronjobs und you want to see the order they are fired.

grafik

Cheers!

Job is not starting at all

Hi @Jako,

thank you for keeping this extra updated 👍

After using the previous version 1.1.0pl for a long time i tried an upgrade to the new one.

But there are some strange happenings with it: while installing the first 1.2.0 version there was an error indicating that its trying (and failing) to install another extra "crosslinks" - it seems that there is a package dependency while its not in the package description. Without that extra the cron manager does not work at all and shows nothing but an error in the log. After installing that additional extra the manager works, as i can add, edit and delete some jobs. But now the cron job (cron.php) does nothing while there is still an active job, no output, no error, nothing.

I have also tried to upgrade to the latest release 1.2.0pl2 but the problem is still the same. Now I restored to the previously installed version 1.1.0pl and it works again.

CronManager only executes one snippet/cronjob at a time

Summary
Creating a cronjob that runs every minute blocks all other cronjobs.

Steps to reproduce the issue

  • setup at least two cronjobs with an interval of 1 minute
  • execute cron.php via Url or Shell

Expected behavior

  • All cronjobs that are scheduled for the upcoming interval should be executed

What do you see instead

  • Only one cronjob is executed while the rest is pending

In my particular example updateCurrentPrice always gets executed when calling cron.php while revokeAccess is pending and never executed.

I am not sure if this is expected behavior but my assumption was that CronManager is acting like a queue here and runs multiple jobs on cron.php if they are pending for execution. Currently the only fix for this is to never set a 1 minute interval for any job. The lowest you can go is 2 minutes so that there is always a "free" spot in the cron.php execution for any outstanding job.

Bildschirmfoto 2021-02-20 um 10 14 10

No snippet return in the combo-box

Hello
Using either Revo2.2 and Revo2.3 for both I entounter a problem with CronManager that does not list the snippets...
No error in the log ,(neither in modx log or apache log) ...
Hope you can do something I really need CronManager as prerequesite for use with GroupEletters
Thanks

Is there a version for revo2.3?
Cheers

FR - Longer log message

Ability to have long log messages. This would imply a window, a-la-modx console, to read the full length message.

Featureslist

Below a short fieature list of the Cron Manager

  • Add a cron script to the crontab of the server, running every minute
  • Adding records via de manager
  • Every records contains a snippet name to run, properties/propertyset name, interval in minutes

Update the UI, no more page reloads

Thanks to Nathan Hatfield, no more page reloads to view logs. They are now on same page but in separate tab but are still accessible by right click on log.

Not Working 2.1.3

Hi there,

I'm trying to get your script to work with 2.1.3 and it appears not to work. When running the cron I get the following error emailed to me. MODx does not register that the cron has run either.

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent in /home/site/core/model/modx/modx.class.php on line 1975
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/site/core/model/modx/modx.class.php:1975) in /home/site/core/model/modx/modx.class.php on line 1975

Any idea why that would be?

Multiple processes

I have multiple cron jobs. Some run every 15 minutes, others run once a day. Some of those once a day cron jobs takes more than 15 minutes to run. So what sometimes happens is that it will run that job twice because the "next run" doesn't update until after the cron job runs. What I think we need is the "next run" to update first or some sort of block placed on that job if it is already running.

Purge logs without error deletes all log entries

The action button in the cron logs grid that is labeled Purge logs without error deletes all logs no matter if the error flag is set for an entry in the db. The grid display filter is working correctly.

MODX 2.8.1
CronManager 1.2.1

bug/feature: Inactive jobs run once when they've never run before

I found a bug in the job selection part of cron.php. But it could also be named a feature.

The job selection conditions in cron.php seem not correct.
Job's which never ran before are running once when cron.php is called, even when the jobs are inactive.

I propose to change assets/components/cronmanager/cron.php line 17-21 into:
$cronjobs = $modx->getCollection('modCronjob', array(
array('nextrun' => null,
'OR:nextrun:<=' => $rundatetime),
'AND:active:=' => true,
));

By this the job selection criteria will be working correctly.

Cron Manager doesn't work with "exit"

The Cron manager does not work with " exit ()". If I use exit() in a code snippet, the time is not transferred to the next iteration. As a result, one snippet starts executing indefinitely and blocks the work of the others

Errors in error log

Sometimes such errors appear:
[2012-09-14 02:20:05](ERROR @ /assets/components/cronmanager/cron.php) [[*id]] is not a valid integer and may not be passed to makeUrl()
[2012-09-14 02:21:04](ERROR @ /assets/components/cronmanager/cron.php) [[*id]] is not a valid integer and may not be passed to makeUrl()
[2012-09-14 02:22:04](ERROR @ /assets/components/cronmanager/cron.php) [[*id]] is not a valid integer and may not be passed to makeUrl()

But I can't find any makeUrl in CronManager sources or snippet in the task. So I don't understand where to dig...

Subfolder/multi-domain support

I just tried for the first time to use the Extra. But because the config.core.php is looked for in a specific place on line 10 of connector.php, as shown here...
require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/config.core.php';
..it won't work with my personal setup, where the MODX install is more of an API than the actual website.

My context containing the data is in a subfolder, so making line 10 read this:
require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/data/config.core.php';
will do the trick. However, on an update this will clearly be overwritten again, causing the whole thing to break down, if I don't think about it.

Clearly, I'll be in a minority here anyways, and I suppose I could just leave an otherwise unused config.core.php in the folder it is looked for. But I feel a simple textfield where you can customize the path to the config file would do the trick.

You can still set the default path to /config.core.php (and doing the redirecting to the root folder the way it's done now), but allowing users to harden their installations the way they see fit seems like the more flexible option to me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.