Share
Embed
Dive into MaintenanceTasks
hatsu
August 01, 2024
Transcript
81 slides
-
ࣗݾհ • Rubyྺ 5 = ΤϯδχΞྺ • SHE Inc. •
React.js / TypeScript / GitHub Actions • Ruby͕Ұ൪͖ -
ٕज़ελοΫ • Backend: Ruby, Ruby on Rails, GraphQL, Sidekiq •
Frontend: React.js, TypeScript, Next.js • CI: GitHub Actions • Infrastructure: Kubernetes -
Rake taskͷ࣮ߦํ๏ 1. podʹkubectl exec … bashͰೖΔ 2. bundle exec
rake … 3. ్தͰࣦഊͨ͠Β࢝Ί͔Β… -
ຊ൪αʔόʔʹೖΔͷා͍🙅 Rake taskͷ࣮ߦํ๏ 1. podʹkubectl exec … bashͰೖΔ 2. bundle
exec rake … 3. ్தͰࣦഊͨ͠Β࢝Ί͔Β… -
ຊ൪αʔόʔͰखಈͰίϚϯυ࣮ߦා͍🙅 Rake taskͷ࣮ߦํ๏ 1. podʹkubectl exec … bashͰೖΔ 2. bundle
exec rake … 3. ్தͰࣦഊͨ͠Β࢝Ί͔Β… ຊ൪αʔόʔʹೖΔͷා͍🙅 -
ຊ൪αʔόʔͰखಈͰίϚϯυ࣮ߦා͍🙅 Rake taskͷ࣮ߦํ๏ 1. podʹkubectl exec … bashͰೖΔ 2. bundle
exec rake … 3. ్தͰࣦഊͨ͠Β࢝Ί͔Β… ຊ൪αʔόʔʹೖΔͷා͍🙅 ࢝Ί͔Β࣮ߦ͢Δͷ͕͔͔࣌ؒΔ🙅 -
Rake taskͷ࣮ߦํ๏ 1. podʹkubectl exec … bashͰೖΔ 2. bundle exec
rake … 3. ్தͰࣦഊͨ͠Β࢝Ί͔Β… ຊ൪αʔόʔͰखಈͰίϚϯυ࣮ߦා͍🙅 ຊ൪αʔόʔʹೖΔͷා͍🙅 ࢝Ί͔Β࣮ߦ͢Δͷ͕͔͔࣌ؒΔ🙅 -
MaintenanceTasksͷ͍ํ ͲͷTaskΛ࣮ߦ͍ͯ͠Δ͔ ։࢝࣌ࠁ ऴྃ࣌ࠁ ࣮ߦ࣌ؒ ࣮ߦ݅ ࣮ߦ(༧ఆ)݅ SecureRandom .uuid ࠶։ॴͷIndex(ID)
࣮ߦεςʔλε(Enum) enqueued / running / succeeded / cancelling / cancelled / interrupted / pausing / paused / errored bin/rails generate maintenance_tasks:install ΤϥʔͷClass ΤϥʔMessage Backtrace -
MaintenanceTaskͷςʔϒϧ ͲͷTaskΛ࣮ߦ͍ͯ͠Δ͔ ։࢝࣌ࠁ ऴྃ࣌ࠁ ࣮ߦ࣌ؒ ࣮ߦ݅ ࣮ߦ(༧ఆ)݅ SecureRandom .uuid ࠶։ॴͷIndex(ID)
࣮ߦεςʔλε(Enum) enqueued / running / succeeded / cancelling / cancelled / interrupted / pausing / paused / errored bin/rails generate maintenance_tasks:install ΤϥʔͷClass ΤϥʔMessage Backtrace -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D D ActiveJobͰఆٛ͞Ε͍ͯΔCallback ActiveJobͰఆٛ͞Ε͍ͯΔCallback -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D job-iteration gem͕ఆ͍ٛͯ͠ΔCallback sidekiq v7.3ʹsidekiq-iteration gemͰࣅͨϝιου͕Ճ͞Εͨ -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D 1. MaintenanceTasks::RunͷσʔλΛrunningεςʔλεʹมߋ 2. perform͕࣮ߦ͞ΕΔ -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D 1 1. MaintenanceTasks::RunͷσʔλΛrunningεςʔλεʹมߋ 2. perform͕࣮ߦ͞ΕΔ -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D 1. MaintenanceTasks::RunͷσʔλΛrunningεςʔλεʹมߋ 2. perform͕࣮ߦ͞ΕΔ 1 1 -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D 1. MaintenanceTasks::RunͷσʔλΛrunningεςʔλεʹมߋ 2. perform͕࣮ߦ͞ΕΔ 1 1 2 -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D 1. MaintenanceTasks::RunͷσʔλΛrunningεςʔλεʹมߋ 2. perform͕࣮ߦ͞ΕΔ 1 1 2 2 -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D 1. MaintenanceTasks::RunͷσʔλΛrunningεςʔλεʹมߋ 2. perform͕࣮ߦ͞ΕΔ 1 1 2 2 ରσʔλͷྻ࡞ -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D 1. MaintenanceTasks::RunͷσʔλΛrunningεςʔλεʹมߋ 2. perform͕࣮ߦ͞ΕΔ 1 1 2 2 1ͭ1ͭσʔλΛॲཧ(Processϝιουͷ࣮ߦ) ରσʔλͷྻ࡞ -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D 1. MaintenanceTasks::RunͷσʔλΛrunningεςʔλεʹมߋ 2. perform͕࣮ߦ͞ΕΔ 1 1 2 2 shutdown callbackͷ࣮ߦ ରσʔλͷྻ࡞ 1ͭ1ͭσʔλΛॲཧ(Processϝιουͷ࣮ߦ) -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D 1. MaintenanceTasks::RunͷσʔλΛrunningεςʔλεʹมߋ 2. perform͕࣮ߦ͞ΕΔ 1 1 2 2 shutdown callbackͷ࣮ߦ complete callbackͷ࣮ߦ ରσʔλͷྻ࡞ 1ͭ1ͭσʔλΛॲཧ(Processϝιουͷ࣮ߦ) -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D 1. ॲཧ͖͢σʔλͷྻΛ࡞ 2. on_startϝιου࣮ߦ 3. RunϞσϧͷσʔλͷ։࢝࣌ࠁͱॲཧ༧ఆ݅Λߋ৽ 1. update!(started_at: Time.now, tick_total: count) -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D 1. ॲཧ͖͢σʔλͷྻΛ࡞ 2. on_startϝιου࣮ߦ 3. RunϞσϧͷσʔλͷ։࢝࣌ࠁͱॲཧ༧ఆ݅Λߋ৽ 1. update!(started_at: Time.now, tick_total: count) 3 -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D 1. ॲཧ͖͢σʔλͷྻΛ࡞ 2. on_startϝιου࣮ߦ 3. RunϞσϧͷσʔλͷ։࢝࣌ࠁͱॲཧ༧ఆ݅Λߋ৽ 1. update!(started_at: Time.now, tick_total: count) 3 3 -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D 1. MaintenanceTaskʹࣗͰॻ͍ͨdef process͕࣮ߦ͞ΕΔ 2. ݱࡏͷॲཧ݅ͱܦա࣌ؒΛߋ৽ -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D 1. MaintenanceTaskʹࣗͰॻ͍ͨdef process͕࣮ߦ͞ΕΔ 2. ݱࡏͷॲཧ݅ͱܦա࣌ؒΛߋ৽ 1 -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D 1. MaintenanceTaskʹࣗͰॻ͍ͨdef process͕࣮ߦ͞ΕΔ 2. ݱࡏͷॲཧ݅ͱܦա࣌ؒΛߋ৽ 1 1 -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D 1. MaintenanceTaskʹࣗͰॻ͍ͨdef process͕࣮ߦ͞ΕΔ 2. ݱࡏͷॲཧ݅ͱܦա࣌ؒΛߋ৽ 1 1 2 -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D D 1. ݱࡏͷॲཧ݅ͱܦա࣌ؒΛߋ৽ 2. cursorͷૠೖ 3. ΤϥʔͷClassBacktraceErrorϝοηʔδΛrunσʔλʹอଘ -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D D 1 1. ݱࡏͷॲཧ݅ͱܦա࣌ؒΛߋ৽ 2. cursorͷૠೖ 3. ΤϥʔͷClassBacktraceErrorϝοηʔδΛrunσʔλʹอଘ -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D D 1. ݱࡏͷॲཧ݅ͱܦա࣌ؒΛߋ৽ 2. cursorͷૠೖ 3. ΤϥʔͷClassBacktraceErrorϝοηʔδΛrunσʔλʹอଘ 1 2 -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D D 1 3 1. ݱࡏͷॲཧ݅ͱܦա࣌ؒΛߋ৽ 2. cursorͷૠೖ 3. ΤϥʔͷClassBacktraceErrorϝοηʔδΛrunσʔλʹอଘ 2 -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D D 1 3 3 1. ݱࡏͷॲཧ݅ͱܦա࣌ؒΛߋ৽ 2. cursorͷૠೖ 3. ΤϥʔͷClassBacktraceErrorϝοηʔδΛrunσʔλʹอଘ 2 -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D 1. εςʔλεʹcancelled / paused / interrupted ͱcursorૠೖ(อଘ·ͩ) 2. ݱࡏͷॲཧ݅ͱܦա࣌ؒΛߋ৽ -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D 1 1. εςʔλεʹcancelled / paused / interruptedͷૠೖ(อଘ·ͩ) 2. Cursorૠೖ(อଘ·ͩ) 3. ݱࡏͷॲཧ݅ͱܦա࣌ؒΛߋ৽ -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D 1 1 1. εςʔλεʹcancelled / paused / interruptedͷૠೖ(อଘ·ͩ) 2. Cursorૠೖ(อଘ·ͩ) 3. ݱࡏͷॲཧ݅ͱܦա࣌ؒΛߋ৽ -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D 1. εςʔλεʹcancelled / paused / interruptedͷૠೖ(อଘ·ͩ) 2. Cursorૠೖ(อଘ·ͩ) 3. ݱࡏͷॲཧ݅ͱܦա࣌ؒΛߋ৽ 1 1 2 -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D 1 1 3 2 1. εςʔλεʹcancelled / paused / interruptedͷૠೖ(อଘ·ͩ) 2. Cursorૠೖ(อଘ·ͩ) 3. ݱࡏͷॲཧ݅ͱܦա࣌ؒΛߋ৽ -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D D 1. statusʹsucceededΛɺended_atʹTime.nowʹૠೖ(อଘ·ͩ) -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D D 1. statusʹsucceededΛɺended_atʹTime.nowʹૠೖ(อଘ·ͩ) 1 -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D D 1. ૠೖ͍ͯͨ͠cursorstatusended_atΛอଘ -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D D 1. ૠೖ͍ͯͨ͠cursorstatusended_atΛอଘ 1 -
Enqueue͞Εͨ͋ͱͷྲྀΕ(ͬ͘͟Γ) 1. before_perform: Perform͕ݺΕΔલʹ࣮ߦ͞ΕΔɻ 2. on_start: Perform͞Εͨޙʹ࣮ߦ͞ΕΔɻ 3. each_iteration: ActiveRecord::RelationΛҰͭͣͭॲཧ͢Δɻ
1. on_error: StandardErrorͰݺΕΔ 4. on_shutdown: ॲཧ͕ऴΘͬͨͱ͖ɻதஅ͞Εͨͱ͖ʹ࣮ߦ͞ΕΔɻ 5. on_complete: on_shutdownͷޙɻ࠶enqueueͷඞཁ͕ͳ͍ͱ͖ɻ 6. after_perform: Perform͕ऴΘͬͨޙʹ࣮ߦ͞ΕΔɻ D D 1. ૠೖ͍ͯͨ͠cursorstatusended_atΛอଘ 1 1