Add separate cron runner that doesn't use proc_open (#1405)
* Add alternative to using the artisan schedule runner * StyleCI fixes * Add additional cron time periods * Style fixes * Typo * Update the web cron to use the new system * Write out JSON for which tasks were run * Rename cron.php to just cron
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace App\Http\Controllers\Api;
|
||||
|
||||
use App\Console\Cron;
|
||||
use App\Contracts\Controller;
|
||||
use App\Exceptions\CronInvalid;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
|
||||
class MaintenanceController extends Controller
|
||||
{
|
||||
@@ -24,12 +24,12 @@ class MaintenanceController extends Controller
|
||||
throw new CronInvalid();
|
||||
}
|
||||
|
||||
$output = '';
|
||||
Artisan::call('schedule:run');
|
||||
$output .= trim(Artisan::output());
|
||||
$cron = app(Cron::class);
|
||||
$run = $cron->run();
|
||||
|
||||
return response([
|
||||
'content' => $output,
|
||||
return response()->json([
|
||||
'count' => count($run),
|
||||
'tasks' => $run,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user