mirror of
https://github.com/nextcloud/server.git
synced 2026-04-21 14:23:17 -04:00
fix(bg-jobs): fix minor issues
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
parent
d69b8ecf95
commit
a3d8632fbe
2 changed files with 3 additions and 8 deletions
|
|
@ -36,11 +36,6 @@ use Symfony\Component\Console\Output\OutputInterface;
|
|||
class JobWorker extends JobBase {
|
||||
private array $executedJobs = [];
|
||||
|
||||
public function __construct(IJobList $jobList,
|
||||
LoggerInterface $logger) {
|
||||
parent::__construct($jobList, $logger);
|
||||
}
|
||||
|
||||
protected function configure(): void {
|
||||
parent::configure();
|
||||
|
||||
|
|
@ -76,6 +71,8 @@ class JobWorker extends JobBase {
|
|||
return 1;
|
||||
}
|
||||
|
||||
$interval = (int)($input->getOption('interval') ?? 5);
|
||||
|
||||
while (true) {
|
||||
// Handle canceling of the process
|
||||
try {
|
||||
|
|
@ -89,8 +86,6 @@ class JobWorker extends JobBase {
|
|||
|
||||
$this->printSummary($input, $output);
|
||||
|
||||
$interval = (int)($input->getOption('interval') ?? 5);
|
||||
|
||||
// Unlock jobs that should be executed again after the interval
|
||||
// Alternative could be to set last_checked to interval in the future to avoid the extra locks
|
||||
foreach ($this->executedJobs as $id => $time) {
|
||||
|
|
|
|||
|
|
@ -448,7 +448,7 @@ class JobList implements IJobList {
|
|||
$result = $query->executeQuery();
|
||||
|
||||
$jobs = [];
|
||||
while ($row = $result->fetch()) {
|
||||
while (($row = $result->fetch()) !== false) {
|
||||
$jobs[] = $row;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue