samedi 27 août 2022

RoR + Sidekiq background processes

I'm trying to get my list to go closed when the End Date is met. Could anyone help me? I'm using sidekiq for background processes and I already have my list passing closed status, but not when it reaches the end date.

My table

create_table "lists", force: :cascade do |t|
t.integer "user_id"
t.binary "uuid", limit: 36
t.string "name"
t.string "description"
t.datetime "end_date"
t.integer "status", default: 1
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["user_id"], name: "index_lists_on__user_id"

I did this in the sidekiq so that my list goes to the disabled state

    class HardJob
    include Sidekiq::Job

    def perform(list_id)
     list = List.find list_id
     list.disabled!

     return 0
    end
   end

Aucun commentaire:

Enregistrer un commentaire