is_runnable()
function returns true and I checked the should_run()
function as well which also returns true. My task should run in every 5 minutes maybe that's the problem?Code: Select all
<?php
namespace eff\elite_apps\cron\task\core;
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
class test extends \phpbb\cron\task\base
{
protected $phpbb_root_path;
protected $php_ext;
protected $config;
protected $log;
/**
* Constructor.
*
* @param string $phpbb_root_path The root path
* @param string $php_ext The PHP extension
* @param phpbb_config $config The config
* @param phpbb_log $log object
*/
public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config, \phpbb\log\log $log)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$this->config = $config;
$this->log = $log;
}
/**
* Runs this cron task.
*
* @return null
*/
public function run()
{
$this->log->add('admin','2','127.0.0.1','Running cron task',time());
$this->config->set('elite_apps_last_gc',time());
}
/**
* Returns whether this cron task can run, given current board configuration.
*
* @return bool
*/
public function is_runnable()
{
return true;
}
/**
* Returns whether this cron task should run now, because enough time
* has passed since it was last run.
*
* @return bool
*/
public function should_run()
{
//elite_apps_gc value is 300 (5 minutes)
return $this->config['elite_apps_last_gc'] < time() - $this->config['elite_apps_gc'];
}
}
Code: Select all
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
I'm unable to run cron tasks of extensions on my board.John P wrote:example: viewtopic.php?f=456&t=2228111#p13556906
Thank you. I've already read that topic.Dr.Death wrote:Yes, use the DEV-RC3 Version.
I had the same problems with RC1 / RC2...... viewtopic.php?f=466&t=2252316
Not working even now.Dr.Death wrote:I think so.... my cron task are now working again (as in Beta-4 before)
Oh, a new bug.John P wrote:Think there is a bug in the cron running from web.
I asked already at area51 http://area51.phpbb.com/phpBB/viewtopic ... 81&t=45997 but no answer yet.
Before the garbage collection there should be a cron_release in cron.php
page_footer
function. Is this intended to work like this? I mean if I would like a task to run every 10 minutes then there should be a user on forum on that given time?