- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图让 active_job 与 delay_job 一起工作。一切正常......因为代码按预期执行,但delayed_job条目报告有错误。我得到的错误如下。
uninitialized constant ProcessEventJob
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/activesupport-4.2.1/lib/active_support/inflector/methods.rb:261:in `const_get'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/activesupport-4.2.1/lib/active_support/inflector/methods.rb:261:in `block in constantize'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/activesupport-4.2.1/lib/active_support/inflector/methods.rb:259:in `each'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/activesupport-4.2.1/lib/active_support/inflector/methods.rb:259:in `inject'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/activesupport-4.2.1/lib/active_support/inflector/methods.rb:259:in `constantize'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/activesupport-4.2.1/lib/active_support/core_ext/string/inflections.rb:66:in `constantize'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/activejob-4.2.1/lib/active_job/core.rb:25:in `deserialize'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/activejob-4.2.1/lib/active_job/execution.rb:20:in `execute'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/activejob-4.2.1/lib/active_job/queue_adapters/delayed_job_adapter.rb:34:in `perform'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/backend/base.rb:94:in `block in invoke_job'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:61:in `call'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:61:in `block in initialize'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:66:in `call'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:66:in `execute'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:40:in `run_callbacks'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/backend/base.rb:91:in `invoke_job'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/worker.rb:204:in `block (2 levels) in run'
/home/getsmart/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/timeout.rb:89:in `block in timeout'
/home/getsmart/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/timeout.rb:99:in `call'
/home/getsmart/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/timeout.rb:99:in `timeout'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/worker.rb:204:in `block in run'
/home/getsmart/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/benchmark.rb:303:in `realtime'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/worker.rb:203:in `run'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/worker.rb:280:in `block in reserve_and_run_one_job'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:61:in `call'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:61:in `block in initialize'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:66:in `call'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:66:in `execute'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:40:in `run_callbacks'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/worker.rb:280:in `reserve_and_run_one_job'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/worker.rb:187:in `block in work_off'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/worker.rb:186:in `times'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/worker.rb:186:in `work_off'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/worker.rb:150:in `block (4 levels) in start'
/home/getsmart/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/benchmark.rb:303:in `realtime'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/worker.rb:149:in `block (3 levels) in start'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:61:in `call'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:61:in `block in initialize'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:66:in `call'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:66:in `execute'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:40:in `run_callbacks'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/worker.rb:148:in `block (2 levels) in start'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/worker.rb:147:in `loop'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/worker.rb:147:in `block in start'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/plugins/clear_locks.rb:7:in `call'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/plugins/clear_locks.rb:7:in `block (2 levels) in <class:ClearLocks>'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:79:in `call'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:79:in `block (2 levels) in add'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:61:in `call'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:61:in `block in initialize'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:79:in `call'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:79:in `block in add'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:66:in `call'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:66:in `execute'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/lifecycle.rb:40:in `run_callbacks'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/worker.rb:146:in `start'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/command.rb:124:in `run'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/command.rb:112:in `block in run_process'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/daemons-1.2.2/lib/daemons/application.rb:265:in `call'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/daemons-1.2.2/lib/daemons/application.rb:265:in `block in start_proc'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/daemons-1.2.2/lib/daemons/daemonize.rb:84:in `call'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/daemons-1.2.2/lib/daemons/daemonize.rb:84:in `call_as_daemon'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/daemons-1.2.2/lib/daemons/application.rb:269:in `start_proc'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/daemons-1.2.2/lib/daemons/application.rb:295:in `start'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/daemons-1.2.2/lib/daemons/controller.rb:56:in `run'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/daemons-1.2.2/lib/daemons.rb:193:in `block in run_proc'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/daemons-1.2.2/lib/daemons/cmdline.rb:88:in `call'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/daemons-1.2.2/lib/daemons/cmdline.rb:88:in `catch_exceptions'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/daemons-1.2.2/lib/daemons.rb:192:in `run_proc'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/command.rb:110:in `run_process'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/command.rb:91:in `block in daemonize'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/command.rb:89:in `times'
/home/getsmart/.rvm/gems/ruby-2.2.2@phoenix/gems/delayed_job-4.0.6/lib/delayed/command.rb:89:in `daemonize' bin/delayed_job:5:in `<main>'
ProcessEventJob
是我的工作类(class)是坐在
app/jobs/process_event_job.rb
.
class ProcessEventJob < ActiveJob::Base
queue_as :event_handler_cycle
def perform(event)
Events::EventHandler.new(raw_data: event).call
end
end
ProcessEventJob.perform_later(params)
module Api
module V1
class SegmentEventsController < ApiController
def create
begin
ProcessEventJob.perform_later(params)
render_success
rescue StandardError => e
render_fail
end
end
private
def render_success
render status: 200, json: { "success" => "true" }
end
def render_fail
render status: 400, json: { "success" => "false" }
end
def restrict_access
unless ApiKey.exists?(access_token: params[:access_token])
head :unauthorized
end
end
end
end
end
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Enable Rack::Cache to put a simple HTTP cache in front of your application
# Add `rack-cache` to your Gemfile before enabling this.
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
# config.action_dispatch.rack_cache = true
# Disable Rails's static file server (Apache or nginx will already do this).
config.serve_static_files = false
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
# Generate digests for assets URLs.
config.assets.digest = true
# `config.assets.precompile` has moved to config/initializers/assets.rb
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
# Set to :debug to see everything in the log.
config.log_level = :info
# Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ]
# Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = "http://assets.example.com"
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# config.assets.precompile += %w( search.js )
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
config.action_mailer.raise_delivery_errors = false
config.action_mailer.default_url_options = { :host => 'mywebsite.co.za' }
config.action_mailer.perform_deliveries = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:user_name => 'email',
:password => 'password',
:authentication => 'plain',
:enable_starttls_auto => true }
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
# Disable automatic flushing of the log to improve performance.
# config.autoflush_log = false
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
config.active_job.queue_adapter = :delayed_job
end
最佳答案
你有没有config.active_job.queue_adapter = :delayed_job
在您的 application.rb
?
我有这个文件 script/delayed_job
包含
#!/usr/bin/env ruby
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
require 'delayed/command'
Delayed::Command.new(ARGV).daemonize
RAILS_ENV=staging bundle exec script/delayed_job start
关于ruby-on-rails - 事件作业抛出意外错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31434851/
我希望使用 API 根据处理 Q 的大小更改运行的 Web 作业实例的数量,我知道我可以在门户中设置规则,但最短聚合时间为 60 分钟,并且我如果我们突然遇到大量工作,不希望系统在扩展之前等待 60
假设我有一个 spark 应用程序并且有两个操作导致两个 spark 作业。 //spark Application //Spark Job1 .... erro
大家好! 作为我对Java的自学的一部分,我正在尝试完成可用的Java初学者分配之一here(非常古老的东西-2001) 问题是我不知道如何应对这个挑战:(我将不胜感激任何建议,因为该解决方案不再可用
我一直在使用 HADOOP 1.2.1 服务器,并在那里执行许多 pig 作业。最近,我考虑将我的 Hadoop 服务器更改为 HADOOP 2.2.0。所以我在 HADOOP 2.2.0 中尝试了一
好的,我修复了静态错误。现在我只是想找出为什么每个对象都得到相同的条目(即相同的名字、年龄、体重等)。这是代码: package classlab3b; import classlab3B.BodyM
我的家庭作业中的一个问题需要一些帮助,我已经尝试了大约一个小时,但无法运行。 列出购买商品数量超过每位顾客平均商品数量的顾客 表格如下: Customer(Cnum, CustomerName, Ad
Kubernetes Jobs重复创建 Pod,直到指定数量的容器成功终止。作业通常与更高级别的CronJob机制一起使用,该机制会按循环计划自动启动新作业。 定期使用 Jobs 和 CronJobs
我有以下工作类(我已经删除了实际的工作代码): @On("0 0 1 * * ?") public class DailyJob extends Job { @Override pub
假设您将 cron 作业配置为每分钟运行一次以做某事。如果实际任务运行时间超过一分钟会发生什么? cron 会创建另一个作业实例/线程吗?还是 cron 会等待并确保上一次运行完成? 谢谢! 最佳答案
我们正在使用 TeamCity 7 并想知道是否可以仅在前一个步骤失败时才运行步骤?我们在构建步骤配置中的选项让您可以选择仅在所有步骤都成功时执行,即使步骤失败,或者始终运行它。 有没有办法仅在前一个
我在 oracle 中编写作业以执行存储过程,但是当时机成熟时,它不会无缘无故地发生任何事情。 是否有某种日志可以让我查看是否发生了错误或其他事情? 我使用 dbms_job 包来创建作业 恩克斯。
我正在用 Java 创建一个用于文件共享的 p2p 应用程序。每个对等节点都将在我的机器上的不同端口上运行并监听请求。但我遇到的问题是,当创建 PeerNode 实例时,我的代码会进入无限循环。以下是
我正在尝试创建一个队列,但当我运行 php artisanqueue:work 时它不起作用,我在终端中得到的只是 [2017-11-30 19:56:27] Processing: App\Jobs
我正在使用PHP库phpseclib0.2.2将SSH自动化到我的一台服务器中。我将其设置为每5分钟运行一次的cron任务。 在设置完它并确保其运行等情况下注销后,我看到了以下内容: $ logout
有没有办法获取多分支管道作业扫描收集到的所有分支的名称? 我想设置一个依赖于现有构建作业的夜间构建,因此需要检查多分支作业是否包含某些特定分支。另一种方法是检查现有作业。 最佳答案 我通过使用 Jen
我在编程方面还很陌生,我不太确定如何完成分配给我的学校作业。 Write a function void print_min(unsigned char a, short b,int c),which
我的作业有问题,需要帮助! 问题 1: 完成下面的 Java 方法,以便 raiseToPower(x,n) 将数字 x 提高到整数 n 次方(即计算值 xn )。请记住 x-n = 1/xn,x0
我正在做一项家庭作业,该作业有四个文本字段和一个文本区域,以及一个将文本字段和文本区域保存到文本文件的按钮,每行一个元素。然后,应出现一个对话框通知用户文件已保存。当对话框关闭时,它应该清空文本字段和
我需要运行一个名为ArrayHolder的java程序,它将运行两个线程。 ArrayHolder 将有一个 Array。 ThreadSeven 会用 7 覆盖该 Array 的每个元素,并用 1
在我的程序中,应该读取学生姓名、ID 号和 GPA,将其分配给指定的学生,然后打印出来。一切都编译正常,但出现错误 Error: Could not find or load main class L
我是一名优秀的程序员,十分优秀!