草庐IT

resque-status

全部标签

ruby - 在 resque scheduler 中调度动态作业

我正在尝试使用rails3和resquescheduler测试future的调度作业:以下是我正在使用的代码,但我收到NoMethodErrorset_schedule。Resque.set_schedule("1",{:cron=>"306**1",:class=>"Notify",:queue=>"username",:message=>'notificationmessage'})我尝试使用简单的入队Resque.enqueue(Notify,params[:message])并且效果很好。更新:以下是我遇到的错误:undefinedmethod`set_schedule'for

ruby-on-rails - 如何在 Rails 应用程序中调试 resque 作业

如何在Rails应用程序中调试resque作业?我只想在self.perform函数的日志文件中写入一些信息。这是我写的system("echosos>>/home/maruf/Desktop/log.txt")在self.perform()中。但什么也没发生。什么是正确的方法? 最佳答案 为什么不使用Logger工具?log=Logger.new'log/resque.log'log.debug"foobar"然后tail-f你新生成的日志在"#{Rails.root}/log/resque.log'。记得重启你的resque工作

ruby - 如何阻止上帝留下陈旧的 Resque 工作流程?

我正在尝试了解如何监控travis-ci的resqueworker|与god以这样一种方式停止resquewatchviagod不会留下陈旧的工作进程。在下文中,我谈论的是工作进程,而不是fork作业子进程(即队列一直是空的)。当我像这样手动启动resqueworker时:$QUEUE=buildsrakeresque:work我会得到一个进程:$psx|grepresque7041s001S+0:05.04resque-1.13.0:Waitingforbuilds一旦我停止工作任务,这个过程就会消失。但是当我开始与上帝(exactconfigurationishere,基本上与re

ruby-on-rails - Resque multiple workers in development 模式

您好,在开发中可以同时运行多个Resqueworker吗?我找到了这段代码,但不确定它是否会工作以及如何工作..http://pastebin.com/9GKk8GwR到目前为止我使用的是标准bundleexecenvrakeresque:workQUEUE='*'redis-server/usr/local/etc/redis.conf 最佳答案 您需要添加一个COUNT环境变量,然后将resque:work更改为resque:workers。例如启动3个worker:bundleexecenvrakeresque:workers

ruby-on-rails - 如何在 resque-retry 和 Rails 4 中测试重试和失败?

我正在尝试编写一个规范来测试resque-retry的重试功能,但我似乎无法让测试正确命中binding.pry。有没有一种方法可以使用rspec3测试此功能,以便我可以验证它们是否按预期运行?这是一个请求规范,我正在尝试通过固定装置模拟实时请求,但无论我尝试什么,我似乎都无法让作业重试。gem'resque',require:'resque/server'gem'resque-web',require:'resque_web'gem'resque-scheduler'gem'resque-retry'gem'resque-lock-timeout'我正在使用resque_rspec,

ruby-on-rails - rails : comparison of Status with Status failed

我需要获取所有current_user.friends状态,然后按created_at对它们进行排序。classUser在Controller中:defindex@statuses=[]current_user.friends.map{|friend|friend.statuses.each{|status|@statusesa.created_at}endcurrent_user.friends返回对象数组Userfriend.statuses返回对象数组Status错误:comparisonofStatuswithStatusfailedapp/controllers/welcom

ruby-on-rails - Rails Resque 工作人员因 PGError : server closed the connection unexpectedly 失败

我在Ubuntu9.10、Rails2.3.4、ruby-ee2010.01、PostgreSQL8.4.2上有站点运行rails应用程序和在生产模式下运行的resqueworkerWorkers不断报错:PGError:serverclosedtheconnectionunexpectedly.我最好的猜测是masterresque进程建立了与db的连接(例如,authlogic在使用User.acts_as_authentic时会这样做),同时加载Rails应用程序类,并且该连接在fork()ed进程(退出时?)中被破坏,所以下一个fork的child会得到一种splinter的全

ruby - 安装 RVM : "Requirements installation failed with status: 1."

这是我在命令提示符之前看到的最后一件事:Searchingforbinaryrubies,thismighttakesometime.Foundremotefilehttps://rvm.io/binaries/osx/10.9/x86_64/ruby-2.1.1.tar.bz2Checkingrequirementsforosx.AbouttoinstallHomebrew,press`Enter`fordefaultinstallationin`/usr/local`,typenewpathifyouwishcustomHomebrewinstallation(thepathnee

ruby-on-rails - Capistrano & Bash : ignore command exit status

我正在使用Capistrano运行远程任务。我的任务是这样的:task:my_taskdorun"my_command"end我的问题是,如果my_command的退出状态为!=0,那么Capistrano认为它失败并退出。当退出状态不为0时,如何让capistrano在退出时继续运行?我已将my_command更改为my_command;echo并且它可以工作,但感觉像是hack。 最佳答案 最简单的方法是将true附加到命令的末尾。task:my_taskdorun"my_command"end成为task:my_taskdor

ruby - Resque vs Sidekiq?

关闭。这个问题需要更多focused.它目前不接受答案。想改进这个问题吗?更新问题,使其只关注一个问题editingthispost.关闭8年前。Improvethisquestion我目前正在为我的后台进程使用Resque,但最近我听到很多关于sidekiq的提示。有人可以比较/区分吗?特别是我想知道是否有一种方法可以通过编程方式监控作业是否在sidekiq中完成