resque

How to alert user when a resque job finishes

心不动则不痛 提交于 2019-12-08 03:36:32
问题 I have a ruby on rails app using the resque gem to process background jobs. I have users trigger background jobs that can take upwards of 10 minutes to complete (they're processing a ton of data). What is the best way to alert the user when the job has completed? I've seen the answer here about using resque-status , is that the only solution? Or is there another way to alert the user through normal resque (which I've already implemented)? 回答1: If you intend to notify a user asynchronously,

Trying to start redis and resque scheduler within a rake task

坚强是说给别人听的谎言 提交于 2019-12-07 19:30:11
问题 I want to start redis and redis-scheduler from a rake task so I'm doing the following: namespace :raketask do task :start do system("QUEUE=* rake resque:work &") system("rake redis:start") system("rake resque:scheduler") end end The problem is the redis starts in the foreground and then this never kicks off the scheduler. If It won't start in the background (using &). Scheduler must be started AFTER redis is up and running. 回答1: similar to nirvdrum. The resque workers are going to fail/quit

How do you configure resque-web to use Resque.redis.namespace?

情到浓时终转凉″ 提交于 2019-12-07 05:09:46
问题 I have set the Resque.redis.namespace for my application and now resque-web not longer displays the workers and queues. Is there some way to get resque-web to be aware of the redis.namespace or ideally multiple redis namspaces? 回答1: Assume that you set Resque.redis.namespace in config/initializers/resque.rb . Than you can run resque-web passing path to this file as command line argument, e.g.: resque-web -p 8282 rails_root/config/initializers/resque.rb Also you can pass namespace directly

Heroku Cedar - no static assets for mounted Resque front-end

我怕爱的太早我们不能终老 提交于 2019-12-07 04:37:59
问题 I have a simple Rails app deployed to the Heroku Cedar stack. The app uses Resque and the Resque Sinatra front-end app is mounted so I can monitor the queue: # routes.rb ... mount Resque::Server, :at => "/resque" This works great, but when deployed to Heroku, the Resque front-end's CSS & JavaScript are not being served. A snippet of Heroku's logs indicates it's returning zero bytes: ... 2011-07-13T16:19:35+00:00 heroku[router]: GET myapp.herokuapp.com/resque/style.css dyno=web.1 queue=0 wait

ruby resque without loading rails environment

≡放荡痞女 提交于 2019-12-06 08:06:45
问题 I have a resque worker which works great but is just too slow. The main reason for this is I'm using activerecord and having to load the entire environment which takes at least 10-20 seconds just to load up (I don't keep a running worker at all times as I'm using Heroku and pay for the time the worker runs). I'm using a resque worker to grab & parse data from an external website and then dumping the data into my database. My question is whether I should rewrite the method to not use Rails and

Trying to start redis and resque scheduler within a rake task

懵懂的女人 提交于 2019-12-06 01:32:07
I want to start redis and redis-scheduler from a rake task so I'm doing the following: namespace :raketask do task :start do system("QUEUE=* rake resque:work &") system("rake redis:start") system("rake resque:scheduler") end end The problem is the redis starts in the foreground and then this never kicks off the scheduler. If It won't start in the background (using &). Scheduler must be started AFTER redis is up and running. similar to nirvdrum. The resque workers are going to fail/quit if redis isn't already running and accepting connections. check out this gist for an example of how to get

apn_sender and Rails 3

白昼怎懂夜的黑 提交于 2019-12-05 12:49:43
I have a project that needs to send notifications from server to device. I don't know how and where to start (create table first or other), because I'm new to Ruby on Rails. I've follow the apn_sender tutorial but it won't work and always errors out on start. Is there any full tutorial to create apn_sender for Rails 3? Thanks Rails 3 and apn_sender I too have been working on the apn_sender problem, because I like that the Apple Push Notification support seems pretty robust. However, the project has been abandoned and now it is falling behind the latest 3 series rails. I have gotten the system

How do I create a resque worker automatically at bootup?

一世执手 提交于 2019-12-05 10:52:17
Ok, I'm making my first ruby app. Who know moving everything over to 'production' is so fugging complicated. So far I've struggled my way through configuring passenger, getting it to run on startup, then getting redis to run on startup. My last task is on startup to add 1 worker. Right now, I have to ssh in and run my rake command rake workers:start . Obviously this is no good when I want to close ssh.. so I just dont really know how or what the next step is. I tried copying resque default config to config.ru and it just blows up Passenger with errors. I also looked into resque-pool which some

How do you configure resque-web to use Resque.redis.namespace?

有些话、适合烂在心里 提交于 2019-12-05 10:09:14
I have set the Resque.redis.namespace for my application and now resque-web not longer displays the workers and queues. Is there some way to get resque-web to be aware of the redis.namespace or ideally multiple redis namspaces? Assume that you set Resque.redis.namespace in config/initializers/resque.rb . Than you can run resque-web passing path to this file as command line argument, e.g.: resque-web -p 8282 rails_root/config/initializers/resque.rb Also you can pass namespace directly through command line option -N like so: resque-web -p 8282 -N myapp 来源: https://stackoverflow.com/questions

Heroku Cedar - no static assets for mounted Resque front-end

十年热恋 提交于 2019-12-05 06:09:46
I have a simple Rails app deployed to the Heroku Cedar stack. The app uses Resque and the Resque Sinatra front-end app is mounted so I can monitor the queue: # routes.rb ... mount Resque::Server, :at => "/resque" This works great, but when deployed to Heroku, the Resque front-end's CSS & JavaScript are not being served. A snippet of Heroku's logs indicates it's returning zero bytes: ... 2011-07-13T16:19:35+00:00 heroku[router]: GET myapp.herokuapp.com/resque/style.css dyno=web.1 queue=0 wait=0ms service=3ms status=200 bytes=0 2011-07-13T16:19:35+00:00 app[web.1]: 2011-07-13T16:19:35+00:00 app