There is a small service for statistics in development. The essence of the task on the crown is to remove positions from Yandex.
According to the results: go to the Kernel class, schedule method and write the following:
$schedule ->job(new RemoverPositions) ->withoutOverlapping() ->runInBackground() ->everyMinute() ->emailOutputTo("g7-99055@yandex.ru"); Employee code RemoverPositions :
class RemoverPositions implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; /** * Create a new job instance. * * @return void */ public function __construct() { $this->test("construct run"); } public function test($value) { //sleep(10); (new Test([ "value" => $value ]))->save(); } public function __invoke() { $this->test("invoke"); } /** * Execute the job. * * @return void */ public function handle() { $this->test("handle"); } } As a result, once a minute and with each request this method is jerked (for some reason, only the constructor works). How to make it so that with ordinary requests (for example, opening a page), he would not do this and still run in the background?
PS: In Laravel completely green, as in the fenemvorki in general, I strongly ask you not to kick)
// UPD: And also when trying to execute the console:
No scheduled commands are ready to run.