laravel-aws-worker
laravel-aws-worker copied to clipboard
Kind of confused between what should be on the app, and what should be on the worker
Hi,
I have to tell it is the first time I use a Worker in Elastic Beanstalk.
I'm a bit confused, because I followed all documentation, and nothing happens :( My worker should send me an email every minutes.
In the Worker logs, I just have:
-------------------------------------
/tmp/sample-app.log
-------------------------------------
2017-03-07 22:09:59 Received task task1 scheduled at 2017-03-07T22:10:00Z.
2017-03-07 22:10:59 Received task task1 scheduled at 2017-03-07T22:11:00Z.
2017-03-07 22:11:59 Received task task1 scheduled at 2017-03-07T22:12:00Z.
2017-03-07 22:12:59 Received task task1 scheduled at 2017-03-07T22:13:00Z.
2017-03-07 22:13:59 Received task task1 scheduled at 2017-03-07T22:14:00Z.
2017-03-07 22:14:59 Received task task1 scheduled at 2017-03-07T22:15:00Z.
2017-03-07 22:15:59 Received task task1 scheduled at 2017-03-07T22:16:00Z.
2017-03-07 22:16:59 Received task task1 scheduled at 2017-03-07T22:17:00Z.
2017-03-07 22:17:59 Received task task1 scheduled at 2017-03-07T22:18:00Z.
2017-03-07 22:18:59 Received task task1 scheduled at 2017-03-07T22:19:00Z.
2017-03-07 22:19:59 Received task task1 scheduled at 2017-03-07T22:20:00Z.
2017-03-07 22:20:59 Received task task1 scheduled at 2017-03-07T22:21:00Z.
2017-03-07 22:21:59 Received task task1 scheduled at 2017-03-07T22:22:00Z.
2017-03-07 22:22:59 Received task task1 scheduled at 2017-03-07T22:23:00Z.
2017-03-07 22:23:59 Received task task1 scheduled at 2017-03-07T22:24:00Z.
So, I don't really know if your plugin should be installed in the Main App, or in the worker The same with cron.yaml, should I install it on the worker???
All I have done is on the main app, I think it is the right way to do this, but I don't really know what task1 is, and no mail is being sent, that's why I think I have missed something...
In my SQS Queue, I can also see no queued job, so, definitively something is not working as it should... Any idea how should I debug it?
@xoco70 in my case I have the same code for both the app servers and the workers. I believe that this is the easiest way to go cause you don't need to test two different setups every time you change something. Maybe you can try merging your codes to see if it works.
@xoco70 this package has to be installed in the worker app (or in both). just make sure your other app is creating/enqueueing jobs and that these jobs land in SQS attached to your worker
@dusterio Do you need to create a new database for the workapp too? If you can use the same database, how do you do that?
@ronaldwraithco You can have the worker operate off the same database. When a worker processes a job from the queue, it follows the configuration specified in the Laravel application to determine which database to use.