File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class ExecutorManager
1111 *
1212 * @var ExecutorPool
1313 */
14- public ExecutorPool $ pool ;
14+ protected ExecutorPool $ pool ;
1515
1616 /**
1717 * The server IPs.
@@ -25,6 +25,16 @@ public function __construct()
2525 $ this ->pool = new ExecutorPool ();
2626 }
2727
28+ /**
29+ * Get the executor pool instance.
30+ *
31+ * @return ExecutorPool
32+ */
33+ public function getPool ()
34+ {
35+ return $ this ->pool ;
36+ }
37+
2838 /**
2939 * Get all executor records.
3040 *
Original file line number Diff line number Diff line change 33namespace Pharaonic \Laravel \Executor \Console ;
44
55use Illuminate \Console \Command ;
6+ use Pharaonic \Laravel \Executor \Facades \Executor as ExecutorFacade ;
67
78class ExecuteCommand extends Command
89{
@@ -26,8 +27,9 @@ class ExecuteCommand extends Command
2627 */
2728 public function handle ()
2829 {
29- $ manager = app ('pharaonic.executor.manager ' );
30- $ items = $ manager ->pool ->collect ($ manager ->getRecords ())->getItems ();
30+ $ items = ExecutorFacade::getPool ()
31+ ->collect (ExecutorFacade::getRecords ())
32+ ->getItems ();
3133
3234 $ name = $ this ->argument ('name ' );
3335 $ tags = $ this ->option ('tags ' );
@@ -50,7 +52,7 @@ public function handle()
5052 if (empty ($ toRun )) {
5153 $ this ->warn ('There are no executors need to be executed. ' );
5254 } else {
53- $ batch = $ manager -> getNextBatchNumber ();
55+ $ batch = ExecutorFacade:: getNextBatchNumber ();
5456
5557 foreach ($ toRun as $ item ) {
5658 $ this ->info ("Executing {$ item ->name }... " );
You can’t perform that action at this time.
0 commit comments