Created
June 9, 2017 17:50
-
-
Save fraterblack/a3c9094dc46f3ec01538f6d8c50bb4e9 to your computer and use it in GitHub Desktop.
Rodar Queues do Laravel em Hospedagem compartilhada - Cpanel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rodar Queues do Laravel em Hospedagem compartilhada | |
//É necessário criar uma método em um controller para executar a queue | |
//Estou chamando a tarefa e dizendo para ser executada somente uma vez | |
public function queue() | |
{ | |
Artisan::call('queue:restart', []); | |
Artisan::call('queue:work', [ | |
'--timeout' => 60, | |
'--memory' => 150, | |
'--tries' => 15, | |
'--once' => true | |
]); | |
} | |
//Depois preciso criar a rota para o controller | |
Route::get('execute-queue/rota-configurada', 'MeuController@queue') | |
//E finalmente configurar o CRON através do Cpanel | |
* * * * wget --quiet -O /dev/null http://www.site.com.br/execute-queue/rota-configurada |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alberto quando fiz esse procedimento, o Laravel estava na versão 5. Acredito que muita coisa tenha mudado.
E o que o @sneycampos disse acima faz mais sentido