Closed JuzerShakir closed 1 week ago
Running bundle exec rake solid_queue:start
cmd no longer outputs anything in the console but listens to the enqueued jobs and executes them.
To ensure that, we can inspect the SQLite file in any SQLite DB software and check the finished_at
column in the solid_queue_jobs
table. It will be populated with a timestamp of when the execution of the job was finished and the jobs that are scheduled for a later time can also be found in the solid_queue_scheduled_executions
table.
But if you still prefer console logs for this over manually checking the db file then the Puma plugin is the way to go. As mentioned in the README.md
file, add plugin: solid_queue
to the puma.rb
file and this will not only listen to jobs while running the server but also print out logs in both the development & production environment. And I would prefer this any day.
Hey @JuzerShakir, thanks for figuring this out! Logs in development are sent to Rails.logger
by default. I think you might find those, if you haven't changed this, in log/development.log
. See https://github.com/rails/solid_queue/issues/238.
This is my first time using the Solid Queue library and I am using it in my project to send emails to the users at a particular date.
To setup the library with my existing project I followed the instructions provided in it's README file and also went through couple of videos from the GoRails & Webcrunch.
So once the database is set up with the Solid Queue tables, I created a Job class that commits the jobs to a solid queue table once I trigger
perform_later
function.For example:
And this is the output it returns:
So the job is successfully queued in and it's ready to run after we start listening to it with this command:
But running this command doesn't output anything in my console, the cursor just blinks in the next line. After a few seconds, I hit
Ctrl+Z
to stop the execution. (Ctrl + C
won't output anything)The configuration file
config/solid_queue.yml
is initialized by the solid queue on setup and comes with the default configurations. I haven't changed anything in it and looks like this:I went through the
issues
tab of this repo but couldn't find anything related to thisI also tried to delete the database and re-run the migrations but the result is the same.
I also restarted my Terminator and laptop just to make sure that it isn't system-specific.
I also went ahead and created a new rails app and integrated the solid queue backend in it but the result is the same, however when hitting
Ctrl+C
to stop the execution it returns this error:And this wasn't the case in my existing project.
So here's the tech stack of my project: Ruby:
3.3.1
Rails:7.1.3.4
SQLite:1.7.3
(Using the litedb adapter to use SQLite database in Fly.io)And here's the
database.yml
file in case you're interested:And yes I have added configuration in the
development.rb
file to execute jobs viasolid_queue
.Has anyone encountered this issue? If yes, or know why this happened, your help would be deeply appreciated. Thanks! :)