• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

daycry / jobs / 24850441053

23 Apr 2026 05:54PM UTC coverage: 52.404% (-1.5%) from 53.938%
24850441053

push

github

daycry
Fixes

104 of 219 new or added lines in 42 files covered. (47.49%)

14 existing lines in 9 files now uncovered.

1210 of 2309 relevant lines covered (52.4%)

4.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Commands/CronJobRunCommand.php
1
<?php
2

3
declare(strict_types=1);
4

5
/**
6
 * This file is part of Daycry Queues.
7
 *
8
 * (c) Daycry <daycry9@proton.me>
9
 *
10
 * For the full copyright and license information, please view
11
 * the LICENSE file that was distributed with this source code.
12
 */
13

14
namespace Daycry\Jobs\Commands;
15

16
use CodeIgniter\CLI\CLI;
17
use Daycry\Jobs\Cronjob\JobRunner;
18

19
/**
20
 * Core scheduler runner: evaluates cron expressions and executes due jobs.
21
 * Intended to be executed every minute by system cron.
22
 */
23
class CronJobRunCommand extends BaseJobsCommand
24
{
25
    protected $name        = 'jobs:cronjob:run';
26
    protected $description = 'Runs jobs based on the schedule, should be configured as a crontask to run every minute.';
27
    protected $usage       = 'jobs:cronjob:run [options]';
28
    protected $options     = [
29
        '-testTime' => 'Set Date to run script',
30
        '-only'     => 'Set name of jobs that you want run separated with comma',
31
        '-oneTime'  => 'Run only one time and exit',
32
    ];
33

34
    public function run(array $params): int
35
    {
36
        if ($this->isActive() === false) {
×
37
            $this->tryToEnable();
×
38

NEW
39
            return self::FAILURE;
×
40
        }
41

42
        $this->getConfig();
×
43

44
        CLI::newLine(1);
×
45
        CLI::write('**** Running Tasks... ****', 'white', 'red');
×
46
        CLI::newLine(1);
×
47

48
        $this->config->init(service('scheduler'));
×
49

50
        $runner = new JobRunner();
×
51

52
        $testTime = $params['testTime'] ?? CLI::getOption('testTime');
×
53

54
        if ($testTime) {
×
55
            $runner->withTestTime($testTime);
×
56
        }
57

58
        $only = $params['only'] ?? CLI::getOption('only');
×
59

60
        if ($only) {
×
61
            $only = explode(',', $only);
×
62
            $runner->only($only);
×
63
        }
64

65
        $runner->run();
×
66

NEW
67
        return self::SUCCESS;
×
68
    }
69
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc