Simulate Cron Jobs & artisan commands
-
Hi, first of all thanks for this awsome work.
-
As you know seting CRON jobs are pain on windows. Is there a way to make it easy with laragon?
-
And for example on laravel you can create queue's as you know,
When you want to use need to run artisan command(s) and in real world example (as far as i know) on linux systems you need to set up supervisor service's for this type of things.
If is it possible laragon has able to handle with these it would be awsome ?
Again thanks for awsome work.
God Bless You.
-
-
@akcan :
- I think Laragon can simulate cron job
- Can you provide more specific info for artisan commands?
-
Hi, thanks for your attention;
About artisan commands,
When you created neccesarry files for queue system we need to runphp artisan queue:work
command from terminal and it runs continusly.this provides processing for queues.
More details can be find here: https://laravel.com/docs/5.8/queues
There are some variations about this commands like
php artisan queue:work --tries=3 php artisan queue:work --once php artisan queue:work --timeout=30 etc..
i know i can open up terminal and can run these commands but i use laragon as a production tool so when server restarted these commands stops.
And these must be run after apache/mysql start and the location of artisan file is project root of laravel.
For example
if i create a project inC:\laragon\www\someproject
folder these artisan must be work in thesomeproject
folder.i hope i can explain (non english person)
-
@akcan : Nice - your answer is very detailed. Good news is Laragon had the feature 2 years ago
The answer is Procfile (Menu > Laragon > Procfile)
In your case, just put:SomeProject Queue=php artisan queue:work --tries=3 autorun pwd=C:\laragon\www\someproject
Take note in
autorun
,pwd
Ref: https://forum.laragon.org/topic/476/laragon-feature-procfile-what-is-it
-
This was pretty awsome before this post i have no idea about that has been implemented
because of the name of the system name i have never clicked that button called "Procfile - What is it?" (my bad)
You are awsome
Thanks for everythnig.
Ps: with this feature could we set the cron jobs ? i check the heroku doc but can't find the details about that.
-
"As you know seting CRON jobs are pain on windows. Is there a way to make it easy with laragon?"
Webcron like easycron.com is useful to webmasters. It allows you to launch any script installed on your webserver or shared hosting account at any time. It is a web-based implementation of the Crontab under Unix/Linux and the Task Scheduler under Windows.