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

daycry / jobs / 21138471384

19 Jan 2026 12:16PM UTC coverage: 62.662% (+0.1%) from 62.561%
21138471384

push

github

daycry
Improve queue atomicity and performance, add index

Introduces atomic job reservation in QueueModel via reserveJob to prevent race conditions in DatabaseQueue. Adds a composite index (status, schedule, priority) for efficient job fetching. Updates ShellJob to sanitize command input. Documentation updated to reflect security and performance improvements.

20 of 25 new or added lines in 4 files covered. (80.0%)

2 existing lines in 2 files now uncovered.

1163 of 1856 relevant lines covered (62.66%)

4.74 hits per line

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

0.0
/src/Jobs/ShellJob.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\Jobs;
15

16
use Daycry\Jobs\Interfaces\JobInterface;
17
use Daycry\Jobs\Job;
18

19
/**
20
 * Executes a shell command using exec().
21
 * Payload: string command to execute. Returns captured output array.
22
 * NOTE: Use cautiously; ensure payload is trusted to avoid command injection.
23
 */
24
class ShellJob extends Job implements JobInterface
25
{
26
    public function handle(mixed $payload): mixed
27
    {
NEW
28
        $payload = escapeshellcmd($payload);
×
UNCOV
29
        exec($payload, $output);
×
30

31
        return $output;
×
32
    }
33

34
    public function beforeRun(Job $job): Job
35
    {
36
        return $job;
×
37
    }
38

39
    public function afterRun(Job $job): Job
40
    {
41
        return $job;
×
42
    }
43
}
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