resque

Docker failing to start rails

泄露秘密 提交于 2020-07-31 03:11:35
问题 I'm trying to start my rails application using rails. It depends on redis, which seems to be working but when rails server starts it fails with Cannot assign requested address - connect(2) for [::1]:6379 (Errno::EADDRNOTAVAIL) . Dockerfile FROM ruby:2.6.1 RUN apt-get update -yqq && \ apt-get install -yqq --no-install-recommends \ nodejs \ nano COPY Gemfile* /usr/src/app/ WORKDIR /usr/src/app RUN bundle install RUN gem install foreman RUN gem install rake -v 12.3.2 COPY . /usr/src/app/ CMD [

Ruby on Rails constantly updating a variable

匆匆过客 提交于 2020-03-06 05:53:19
问题 Currently I am building an application that allows users to place bids on products and admins to approve them. The 'transactions' themselves take place outside of the scope of the application. Currently, users see the price of an asset on the transaction/new page and submit a bid by submitting the form. Admins click a button to approve the bid. class TransactionsController < ApplicationController before_action :get_price def new @price = get_price @tansaction = Transaction.new end ### def get

Solution for background jobs on Heroku?

孤街醉人 提交于 2020-02-04 05:04:47
问题 I've used Delayed Job on Heroku's older stacks (Aspen and Bamboo), but with their new(ish) Cedar stack, I'd like to try something more efficient. The specific background jobs I'm performing are API calls to different carriers (UPS, FedEx, USPS, etc etc) and I typically am processing thousands every hour. I need to be able to process jobs concurrently to get through the queue quickly. On top of that, I'd like to try to reduce costs. On the previous stacks where I've been using Delayed Job, I

Solution for background jobs on Heroku?

拟墨画扇 提交于 2020-02-04 05:04:41
问题 I've used Delayed Job on Heroku's older stacks (Aspen and Bamboo), but with their new(ish) Cedar stack, I'd like to try something more efficient. The specific background jobs I'm performing are API calls to different carriers (UPS, FedEx, USPS, etc etc) and I typically am processing thousands every hour. I need to be able to process jobs concurrently to get through the queue quickly. On top of that, I'd like to try to reduce costs. On the previous stacks where I've been using Delayed Job, I

Rescue : Connection refused - Unable to connect to Redis on localhost:6379

烂漫一生 提交于 2020-01-29 03:18:29
问题 I have followed the instructions to install resque, but now when I try to spawn a worker with this command I get a connection error: $ QUEUE=mailer rake environment resque:work --trace this is the error that I get: Connection refused - Unable to connect to Redis on localhost:6379 回答1: Have you verified redis-server is running? Please don't ask me to dissect the following command, but in a terminal you can type: ps aux | grep redis You should then see something like: redis 13319 0.0 0.0 2884

bluepill not detecting that processes have, in fact, started successfully, and so creates new ones

天涯浪子 提交于 2020-01-25 06:07:12
问题 I have one (EC2) Ubuntu server where bluepill is working just fine to start and monitoring resque processes (and it has done so on other nodes in the past). I'm setting up a new node, and for some reason on this node bluepill does not recognize that the processes have started and are running, and so keeps creating new ones. I'm a little baffled by what's causing this. The 2 nodes are almost identical; they're both EC2 servers provisioned by the same chef scripts. It is true that the one not

bluepill not detecting that processes have, in fact, started successfully, and so creates new ones

流过昼夜 提交于 2020-01-25 06:04:04
问题 I have one (EC2) Ubuntu server where bluepill is working just fine to start and monitoring resque processes (and it has done so on other nodes in the past). I'm setting up a new node, and for some reason on this node bluepill does not recognize that the processes have started and are running, and so keeps creating new ones. I'm a little baffled by what's causing this. The 2 nodes are almost identical; they're both EC2 servers provisioned by the same chef scripts. It is true that the one not

Rails resque: Record not found when passing variable from controller to worker

元气小坏坏 提交于 2020-01-24 21:30:12
问题 I have a very simple controller: def create @poem = Poem.new(params[:poem]) @poem.prose = @poem.content @poem.save Resque.enqueue(PoemWork, @poem.id) .... and a very simple worker: class PoemWork @queue = :poem_queue def self.perform(poem_id) @poem = Poem.find(poem_id) txt = @poem.content #do stuff here @poem.save end end And I keep getting "Couldn't find Poem with id=53" or smth. like that... I tried passing just string, just integer etc.. but it also ends with ActiveRecord::RecordNotFound

Problem in resque: job not getting removed from queue when finished processing

落爺英雄遲暮 提交于 2020-01-16 18:02:34
问题 I am using resque, and resque-scheduler in my rails application. I am facing strange problem in using resque-scheduler. One of my job is not getting removed from queue, once it finishes with the 'perform' method. I need to kill it explicitly to get out of the queue, then other jobs in the queue starts executing. Job class is simple, like: class FooJob @queue = :high_volume def self.perform puts "FooJob#perform:" # some method call end end And resque_schedule.yml contains: add_jobs_from_foo:

Ruby - Exception occured: [Mysql2::Error] closed MySQL connection

喜欢而已 提交于 2020-01-14 07:27:30
问题 I have a Rails application now only runs internally, so there's not so much visits right now. And there're two resque worker running hardly to fetch data from the web and inserts into a mysql database, every insert will followed by sleep 10 second. We run it on a VPS. After like every 5 hours, I will encounter an Exception Exception occured: [Mysql2::Error] closed MySQL connection" . What could be the reason causing the exception? Now the pool size is 5. Will it help if I raise the pool size