Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
CronJob.perform_later
rails active job is work in background?
Yes, when you run AnyJob.perform_later it will enqueue the job to perform in background: https://guides.rubyonrails.org/active_job_basics.html.
You might use sidekiq or resque (or other gems) to execute the background jobs. I'd recommend using sidekiq though.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
How can we lock an ActiveRecord and complete the operations on it before allowing another thread or request to make changes to the ActiveRecord?
I am building an eCommerce site which currently has a huge discount
campaign. Only one unit of your product left. And many people want to
buy it at the exact same time. In such scenario, I need to lock the
product?
In Rails, you could use with_lock
https://apidock.com/rails/ActiveRecord/Locking/Pessimistic/with_lock
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
How to clear garbage collection in ruby? I configured my rails app in AWS. I have used nginx and puma manager.
GC::start but in most cases (read: always) the direct call will make everything worse.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I would like to run a websocket listener on the server to listen for message and update data or invoke worker accordingly. I would like to write it as a Rails module so it can update ActiveRecord and enqueue Sidekiq task seamlessly. What is the good practice in doing this?
I looked through many possible practices and found out that rails runner is the best for me.
You can also look for rake tasks.
And absolutely sure you can give a try to Faye-rails which will handle all the work without running separate workers explicitly.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
How to re-index a particular model in production mode in elasticsearch-rails
Run the following command from terminal
RAILS_ENV=production rake environment elasticsearch:import:model CLASS='Article'
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I would like to exchange / enhance the asset Pipeline with some Grunt tasks. Is there a Way i can integrate grunt into my build process?
You might want to check out the gem half-pipe
And here is a video explaining it