Cronjob for plugin not fireing correctly

  • Heya all!

    I have a simple cronjob for my plugin, which does some aggregation and cleaning once a day. The cronjob is installed during plugin installation and appears just fine in the cronjob management. However it does not seem to fire at all. When I run it manually I get confirmation that cronjob was just run, but nothing seems to happen and the last run time does not update. For the scheduled time it seems the same and I also get a fatal error in the logs, which keeps repeating at interval of about an hour, starting with the time cronjob is scheduled. The content of the run function should be working fine as I have run it to test in the page object.

    1. Type: COMPILE ERROR
    2. Message: require_once(): Failed opening required './core/data_handler/includes/modules/write/magepoints_pending/pdh_w_magepoints_pending.class.php' (include_path='.:/usr/share/php:/usr/share/pear')
    3. Code: File: /var/www/core/data_handler/plus_datahandler.class.php, Line: 280
    4. Trace:
    5. File: , Line: , Function: catch_fatals, Object: plus_debug_logger

  • There is a lot I don't know about php and eqdkp-plus, but fairly sure I've registered the modules as required

    PHP: magepoints_plugin_class.php
    1. $this->add_pdh_write_module('magepoints_pending');
    2. $this->add_pdh_write_module('magepoints_approved');
    3. $this->add_pdh_write_module('magepoints_leaderboards');

    As I've said I have tested the code inside the run function. I've used exact same code in page object and it produced the required results, but when I do it in cronjob it does not work.

  • At the beginning of the run method of your cronjon, you have to add register('pm');. This initialises the plugin management, therefore registered pdh modules will be activated, and you have access to the pdh modules.

    Viele Grüße,

    Bitte sendet mir keine unaufgeforderten Support-PNs. | Please don't send me unwanted support-PMs.
    Du willst dich bei mir bedanken: | You want to thank me:

    amazon_wishlist.jpg paypal_logo.jpg