sidekiq_options queue: :default, retry: 3 5 6 # Bad Design 7 # 8 def perform 9 restaurants = Restaurant.open 10 restaurants.each do |restaurant| 11 restaurant.generate_csv 12 end 13 end 14 end 4 J E F L J R 8 P S L F S ઃ ܭ ͷ ί π
sidekiq_options queue: :reservation, retry: 3 5 6 # Bad Design 7 # 8 def perform(reservation_id, status) 9 reservation = Reservation.find(reservation_id) 10 case status 11 when 'cancelled' 12 reservation.notify_cancelled 13 when 'visited' 14 reservation.notify_visited 15 end 16 end 17 end 4 J E F L J R 8 P S L F S ઃ ܭ ͷ ί π
sidekiq_options queue: :reservation, retry: 3 5 6 def perform(reservation_id) 7 reservation = Reservation.find(reservation_id) 8 reservation.notify_cancelled 9 end 10 end 4 J E F L J R 8 P S L F S ઃ ܭ ͷ ί π
sidekiq_options queue: :reservation, retry: 3 5 6 def perform(reservation_id) 7 reservation = Reservation.find(reservation_id) 8 reservation.notify_visited 9 end 10 end 4 J E F L J R 8 P S L F S ઃ ܭ ͷ ί π
exception| 4 Sidekiq.logger.fatal [self.class.name.underscore.to_sym, :retries_exhausted, msg] 5 Bugsnag.auto_notify(exception) 6 end 7 end 4 J E F L J R 8 P S L F S ઃ ܭ ͷ ί π