Litefs with Rails & Solid queue

G’day legends. Just wondering if anyone can shed some light on the best way to configure a Rails app with Sqlite + Solid queue + Litefs?

Is multiple processes in the fly.toml file the best approach?

[processes]
app = "litefs mount -config /etc/litefs_app.yml"
worker = "litefs mount -config /etc/litefs_worker.yml"

Cheers,

Oli

Hey there! I have been using similar setup as yours and I am wondering are you able to successfully listen to jobs set in job queue in fly.io?

I have configured all of it And is able to queue and execute jobs but not able to execute in production… :neutral_face:

Hey mate! So I found this thread: LiteFS GET request containing writes + LiteFS with multiple processes

It goes into details about how to run multiple processes with Litefs. I had success using just one ‘process’ and having litefs run the app and the worker using Overmind. Hope that points you in the right direction.

1 Like

Thanks for the resource @olinelson !:slight_smile: Hmmmm, I went through the article and it seems beyond my understanding and experience.

All I want is this command bundle exec rake solid_queue:start to run while I am running rails server.

In the development environment, I have added the following command to the Procfile. I run the bin/dev command, it not only runs the rails server but also listens to enqueued jobs and executes them if any.

And I am currently not planning to have a different database for jobs. The one that is created while initializing fly.io is enough!

And since you’re using a solid queue with SQLite I was curious if you could provide 2 cents to this noob! :sweat_smile:

Thanks a ton! :slight_smile:

I just found the solution and it was in the documentation all along.

All I did was add the solid_queue plugin to the Puma configuration file (puma.rb) and it not only executes the jobs but also provides logs to see what’s happening under the hood both in the development and production! :wink:

I would highly recommend this way of execution rather than the bundle exec rake solid_queue:start rake task.

Nice one, wasn’t aware of the Puma plugin approach. Happy coding!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.