You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: audio_features_worker.rb
    path of file: ./repos/plylst/app/workers
    
    the code of the file until where you have to start completion: class AudioFeaturesWorker
  include Sidekiq::Worker
  
  sidekiq_options queue: :slow, lock: :while_executing, on_conflict: :reject

  def perform(track_ids)
    tracks = Track.where(spotify_id: track_ids, key: nil)
    tracks_with_spotify_ids = tracks.pluck(:spotify_id)

    spotify_tracks = RSpotify::AudioFeatures.find(tracks_with_spotify_ids)
    
    spotify_tracks.each do |spotify_tr
    
  def perform(track_ids)
    tracks = Track.where(spotify_id: track_ids, key: nil)
    tracks_with_spotify_ids = tracks.pluck(:spotify_id)

    spotify_tracks = RSpotify::AudioFeatures.find(tracks_with_spotify_ids)
    
    spotify_tracks.each do |spotify_track|
      if spotify_track.present?
        track = tracks.find{|a| a.spotify_id == spotify_track.id}
        track.update_columns(
          acousticness: spotify_track.acousticness,
          danceability: spotify_track.danceability,
          energy: spotify_track.energy,
          instrumentalness: spotify_track.instrumentalness,
          key: spotify_track.key,
          liveness: spotify_track.liveness,
          loudness: spotify_track.loudness,
          mode: spotify_track.mode,
          speechiness: spotify_track.speechiness,
          tempo: spotify_track.tempo,
          time_signature: spotify_track.time_signature,
          valence: spotify_track.valence,
          audio_features_last_checked: Time.now
        )
      end
    end