مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2026-03-03 22:34:09 +00:00
style(rubocop): fix all safe auto correctable offenses
هذا الالتزام موجود في:
@@ -1,16 +1,15 @@
|
||||
require 'nifty/utils/random_string'
|
||||
require "nifty/utils/random_string"
|
||||
|
||||
module Postal
|
||||
class Job
|
||||
|
||||
def initialize(id, params = {})
|
||||
@id = id
|
||||
@params = params.with_indifferent_access
|
||||
on_initialize
|
||||
end
|
||||
|
||||
def id
|
||||
@id
|
||||
end
|
||||
attr_reader :id
|
||||
|
||||
def params
|
||||
@params || {}
|
||||
@@ -33,14 +32,15 @@ module Postal
|
||||
end
|
||||
|
||||
def self.queue(queue, params = {})
|
||||
job_id = Nifty::Utils::RandomString.generate(:length => 10).upcase
|
||||
job_payload = {'params' => params, 'class_name' => self.name, 'id' => job_id, 'queue' => queue}
|
||||
Postal::Worker.job_queue(queue).publish(job_payload.to_json, :persistent => false)
|
||||
job_id = Nifty::Utils::RandomString.generate(length: 10).upcase
|
||||
job_payload = { "params" => params, "class_name" => name, "id" => job_id, "queue" => queue }
|
||||
Postal::Worker.job_queue(queue).publish(job_payload.to_json, persistent: false)
|
||||
job_id
|
||||
end
|
||||
|
||||
def self.perform(params = {})
|
||||
new(nil, params).perform
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم