lib/rails_cloud_tasks/rack/jobs.rb in rails-cloud-tasks-0.0.4.rc1 vs lib/rails_cloud_tasks/rack/jobs.rb in rails-cloud-tasks-0.0.4rc2
- old
+ new
@@ -12,10 +12,15 @@
"RailsCloudTasks/#{job_class}/perform_now"
)
request = ::Rack::Request.new(env)
job_args = extract_args(request)
- job_class.perform_now(job_args)
+
+ if job_args
+ job_class.perform_now(job_args)
+ else
+ job_class.perform_now
+ end
response(200, {})
rescue Rack::InvalidPayloadError => e
response(422, { error: e.message })
rescue StandardError => e