问题标签 [resque-status]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ruby - 在 resque-status 作业中添加状态
我正在尝试将我的工作内部的值传递给状态哈希,完全如此处所述:https ://github.com/quirkey/resque-status#passing-back-data-from-the-job
但我不明白我应该怎么做。这是我的工作课程:
但是当我在完成后检查作业时:
'output_url' 键永远不存在。
ruby-on-rails - Resque 作业和 rspec
我有一个 Resque 工作,我正在尝试使用 rspec 进行测试。这份工作看起来像:
我正在使用 Resque 状态,所以我使用 create 方法来创建作业,如下所示:
如果我尝试在 rspec 测试中以相同的方式创建作业,则选项似乎无法完成作业。如,当我在 之后插入 binding.pry 时user = options['user']
,选项哈希为空。
我的 rspec 测试如下所示:
c++ - Ruby on Rails working in background [resque + resque-status]
I am building a webapp using ruby on rails that requires running C++ exe programs in the background. I compared 3 most frequently used gems for this(Delayed_Jobs, Resque, Sidekiq) and found that resque is the most suitable for me.
In Countroller I have create method like this
In Worker class I have
Now my question is how should I detect that job has finished? I want to send gemerated image file to client once images are generated by C++ application. which usercan view/download.
As redirect_to model_path(@model.id) will return after Resque.enqueue(JobWorker, @model.file.url) in the create in controller.
I tried using resque-status but that requires polling in the controller to check the status like...
Any suggestions?? Thank you in Advance...
heroku - 如何在复杂作业中处理具有 resque-status 的 SIGTERM
我一直在 Heroku 上使用 resque,它会不时用 SIGTERM 中断你的工作。
到目前为止,我已经用一个简单的方法处理了这个问题:
我们已经开始使用 resque-status 以便我们可以跟踪作业,但是上面的方法显然打破了这一点,因为当作业实际上被推迟到另一个作业时,它会显示已完成。
我目前的想法是,与其在 resque 中推迟当前的工作,还需要另一个工作来重新排队由于 SIGTERM 而失败的工作。
诀窍在于一些工作更复杂:
当 do_part1 重复时,简单地删除救援并简单地重试这些作业会导致异常。
ruby-on-rails - 如何在控制台中运行 resque 作业?
我试图在控制台中调用作业,但总是出错。
遵循以下文档:
- http://tutorials.jumpstartlab.com/topics/performance/background_jobs.html
- https://www.youtube.com/watch?v=UrE47tCrZXc
- https://guides.rubyonrails.org/active_job_basics.html
- https://github.com/resque/resque
- 如何在 Rails 控制台中运行 ActiveJob 进行调试?
创建了以下文件:(lib/jobs/archive_survey_jobs.rb)
我知道我可以做类似的事情Resque.enqueue(ArchiveSurveysJob, 'string_here')
如何在控制台中调用它?如果我尝试:
Jobs::ArchiveSurveysJob.create(survey_type: 'string_here')
,当我检查 Resque 状态时,它会导致错误:`任务因错误而失败:
未定义的局部变量或方法 `args' for #
如果我试试这个:
或者:
我得到:
ArgumentError:参数数量错误(给定 0,预期 1..2)
如果我遗漏了一些文档或者我做错了什么,请告诉我。