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

orisai / scheduler / 24223014958

10 Apr 2026 02:16AM UTC coverage: 97.796% (-0.1%) from 97.925%
24223014958

push

github

mabar
JobResult->hasLockExpiredEarly() for checking too short lock periods in after job callbacks

6 of 7 new or added lines in 3 files covered. (85.71%)

3 existing lines in 3 files now uncovered.

2795 of 2858 relevant lines covered (97.8%)

70.99 hits per line

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

83.33
/src/Job/JobLock.php
1
<?php declare(strict_types = 1);
2

3
namespace Orisai\Scheduler\Job;
4

5
use Symfony\Component\Lock\LockInterface;
6

7
final class JobLock
8
{
9

10
        private LockInterface $lock;
11

12
        public function __construct(LockInterface $lock)
13
        {
14
                $this->lock = $lock;
400✔
15
        }
16

17
        /**
18
         * @deprecated Always returns true inside a job. Will be removed in v3.0.
19
         */
20
        public function isAcquiredByCurrentProcess(): bool
21
        {
22
                return $this->lock->isAcquired();
8✔
23
        }
24

25
        public function isExpired(): bool
26
        {
27
                return $this->lock->isExpired();
8✔
28
        }
29

30
        /**
31
         * @deprecated Use extendTo() instead. Will be removed in v3.0.
32
         */
33
        public function refresh(?float $ttl = null): void
34
        {
35
                $this->lock->refresh($ttl);
16✔
36
        }
37

38
        /**
39
         * Extends the lock expiration to given number of seconds from now.
40
         * Call periodically in long-running jobs to prevent lock expiry.
41
         */
42
        public function extendTo(float $seconds): void
43
        {
UNCOV
44
                $this->lock->refresh($seconds);
×
45
        }
46

47
        public function getRemainingLifetime(): ?float
48
        {
49
                return $this->lock->getRemainingLifetime();
8✔
50
        }
51

52
}
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