<commit_before>class PhotoWorker
  include Sidekiq::Worker
  sidekiq_options :retry => false

  def perform(photo_id)
    puts "worker starting to process photo..."
    photo = Photo.find(photo_id)
    puts "calling recreate versions on photosuploader..."
    photo.picture.recreate_versions!
    puts "recreate_versions sucess..."
    photo.processed_at = Time.zone.now
    puts "worker finished processing photo..."
    photo.save!
    puts "photo is saved..."
  end
end<commit_msg>background worker working properly<commit_after>class PhotoWorker
  include Sidekiq::Worker
  sidekiq_options :retry => false

  def perform(photo_id)
    puts "worker starting to process photo..."
    photo = Photo.find(photo_id)
    puts "photo object is #{photo}..."
    puts "calling process_in_background on photo.picture..."
    photo.picture.recreate_versions!(:gallery_fill, :gallery_fill_thumbnail, :gallery_fill_cover)
    # photo.picture.process_in_background
    puts "recreate_versions sucess..."
    photo.processed_at = Time.zone.now
    puts "worker finished processing photo..."
    photo.save!
    puts "photo is saved..."
  end
end
{'fraction_non_alphanumeric': 0.10141093474426807, 'fraction_numerical': 0.0, 'mean_word_length': 3.613821138211382, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '939187', 'n_tokens_mistral': 332, 'n_tokens_neox': 336, 'n_words': 91}