如何从delayed_job工作中获取stdout?

时间:2012-06-20 14:32:14

标签: stdout delayed-job stderr exit-code

我需要从rails运行一些外部OS Scommands,我需要向用户显示它们的输出和退出代码。我检查了延迟::作业 API,但没看到如何获得作业的标准输出。试过 BJ (BackgroungJob) - 它有stdout,stderr和exit_status方法,但它在rails开始时失败:

~/my_src/ruby_apps/ro > script/rails c
DEPRECATION WARNING: Calling set_table_name is deprecated. Please use `self.table_name = 'the_name'` instead. (called from <top (required)> at /home/zhoran/my_src/ruby_apps/ro/config/application.rb:7)
DEPRECATION WARNING: Calling set_primary_key is deprecated. Please use `self.primary_key = 'the_name'` instead. (called from <top (required)> at /home/zhoran/my_src/ruby_apps/ro/config/application.rb:7)
DEPRECATION WARNING: Calling set_table_name is deprecated. Please use `self.table_name = 'the_name'` instead. (called from <top (required)> at /home/zhoran/my_src/ruby_apps/ro/config/application.rb:7)
DEPRECATION WARNING: Calling set_primary_key is deprecated. Please use `self.primary_key = 'the_name'` instead. (called from <top (required)> at /home/zhoran/my_src/ruby_apps/ro/config/application.rb:7)
DEPRECATION WARNING: Calling set_table_name is deprecated. Please use `self.table_name = 'the_name'` instead. (called from <top (required)> at /home/zhoran/my_src/ruby_apps/ro/config/application.rb:7)
DEPRECATION WARNING: Calling set_primary_key is deprecated. Please use `self.primary_key = 'the_name'` instead. (called from <top (required)> at /home/zhoran/my_src/ruby_apps/ro/config/application.rb:7)
script/rails:6: stack level too deep (SystemStackError)

似乎与3.2.3

不兼容

请帮助我从延迟工作中获取stderr,stdout和退出代码或建议类似BJ的东西。

0 个答案:

没有答案