Added support for a backlink in scheduler

This commit is contained in:
Andy Miller
2019-02-18 13:18:01 -07:00
parent 3545761b92
commit 3c680cd8e8
3 changed files with 20 additions and 0 deletions

View File

@@ -62,6 +62,7 @@ class Backups
$job = $scheduler->addFunction('Grav\Common\Backup\Backups::backup', [$id], $name );
$job->at($at);
$job->output($logs);
$job->backlink('/tools/backups');
}
}

View File

@@ -602,6 +602,7 @@ class Cache extends Getters
$job = $scheduler->addFunction('Grav\Common\Cache::purgeJob', [], $name );
$job->at($at);
$job->output($logs);
$job->backlink('/config/system#caching');
// Cache Clear
$at = $config->get('system.cache.clear_at');
@@ -612,6 +613,7 @@ class Cache extends Getters
$job = $scheduler->addFunction('Grav\Common\Cache::clearJob', [$clear_type], $name );
$job->at($at);
$job->output($logs);
$job->backlink('/config/system#caching');
}

View File

@@ -39,6 +39,7 @@ class Job
private $outputMode;
private $process;
private $successful = false;
private $backlink;
/**
* Create a new Job instance.
@@ -183,6 +184,22 @@ class Job
return $this;
}
/**
* Sets/Gets an option backlink
*
* @param $link string
*
* @return null|string
*/
public function backlink($link = null)
{
if ($link) {
$this->backlink = $link;
}
return $this->backlink;
}
/**
* Check if the Job can run in background.
*