Skip to content

Commit c98ea3b

Browse files
committed
Add custom MutexRuntimeException
1 parent 37dc2d4 commit c98ea3b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/MutexRuntimeException.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
namespace Illuminated\Console;
4+
5+
use RuntimeException;
6+
7+
class MutexRuntimeException extends RuntimeException
8+
{
9+
}

src/WithoutOverlapping.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ protected function initializeMutex()
1919
{
2020
$mutex = new Mutex($this);
2121
if (!$mutex->acquireLock($this->getMutexTimeout())) {
22-
throw new RuntimeException('Command is running now!');
22+
throw new MutexRuntimeException('Command is running now!');
2323
}
2424

2525
register_shutdown_function([$this, 'releaseMutexLock'], $mutex);

0 commit comments

Comments
 (0)