Skip to content

Commit b3fc249

Browse files
committed
Update of MutexConsoleCommandBehavior to support wildcard attaching to
all actions.
1 parent 1f3828e commit b3fc249

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

behaviors/MutexConsoleCommandBehavior.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* return array(
1818
* 'mutexBehavior' => array(
1919
* 'class' => 'yii2mod\cron\behaviors\MutexConsoleCommandBehavior',
20-
* 'mutexActions' => array('index'),
20+
* 'mutexActions' => array('index'), // OR ['*'] - attach to all actions
2121
* ),
2222
* );
2323
* }
@@ -84,7 +84,7 @@ protected function composeMutexName($action)
8484
*/
8585
public function checkIsMutexAction($action)
8686
{
87-
return in_array(strtolower($action), $this->mutexActions);
87+
return in_array(strtolower($action), $this->mutexActions) || in_array('*', $this->mutexActions);
8888
}
8989

9090

0 commit comments

Comments
 (0)