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:
Nabeel S
2022-02-11 16:24:06 -05:00
committed by GitHub
parent 607ea6f5e5
commit 78fd8367a1
20 changed files with 337 additions and 35 deletions

View File

@@ -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,
]);
}
}