@@ -96,6 +96,33 @@ protected function execute(InputInterface $input, OutputInterface $output)
96
96
return \Magento \Framework \Console \Cli::RETURN_FAILURE ;
97
97
}
98
98
99
+ $ returnCode = $ this ->executeJobsFromQueue ();
100
+ if ($ returnCode != \Magento \Framework \Console \Cli::RETURN_SUCCESS ) {
101
+ $ output ->writeln ($ notification );
102
+ }
103
+
104
+ return $ returnCode ;
105
+ }
106
+
107
+ /**
108
+ * Check if Cron job can be run
109
+ *
110
+ * @return bool
111
+ */
112
+ private function checkRun ()
113
+ {
114
+ return $ this ->readinessCheck ->runReadinessCheck ()
115
+ && !$ this ->status ->isUpdateInProgress ()
116
+ && !$ this ->status ->isUpdateError ();
117
+ }
118
+
119
+ /**
120
+ * Executes setup jobs from the queue
121
+ *
122
+ * @return int
123
+ */
124
+ private function executeJobsFromQueue ()
125
+ {
99
126
$ returnCode = \Magento \Framework \Console \Cli::RETURN_SUCCESS ;
100
127
try {
101
128
while (!empty ($ this ->queue ->peek ()) && strpos ($ this ->queue ->peek ()[Queue::KEY_JOB_NAME ], 'setup: ' ) === 0 ) {
@@ -125,29 +152,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
125
152
$ returnCode = \Magento \Framework \Console \Cli::RETURN_FAILURE ;
126
153
} finally {
127
154
$ this ->status ->toggleUpdateInProgress (false );
128
- if ($ returnCode != \Magento \Framework \Console \Cli::RETURN_SUCCESS ) {
129
- $ output ->writeln ($ notification );
130
- }
131
- return $ returnCode ;
132
- }
133
-
134
- if ($ this ->status ->isUpdateError ()) {
135
- // we must have an exit code higher than zero to indicate something was wrong
136
- return \Magento \Framework \Console \Cli::RETURN_FAILURE ;
137
155
}
138
-
139
- return \Magento \Framework \Console \Cli::RETURN_SUCCESS ;
140
- }
141
-
142
- /**
143
- * Check if Cron job can be run
144
- *
145
- * @return bool
146
- */
147
- private function checkRun ()
148
- {
149
- return $ this ->readinessCheck ->runReadinessCheck ()
150
- && !$ this ->status ->isUpdateInProgress ()
151
- && !$ this ->status ->isUpdateError ();
156
+ return $ returnCode ;
152
157
}
153
158
}
0 commit comments