<commit_before>class TweeterWorker
  include Sidekiq::Worker

  def perform(tweet_id)
    tweet = Tweet.find(tweet_id)

    return if tweet.twitter_id.present?
    #tweet.with_lock do  Doesnt work with pgbouncer...
    #  next if tweet.twitter_id.present?

    sleep(tweet.scheduled_at - Time.now) while tweet.scheduled_at > Time.now

    begin
      tweet.send_tweet
    rescue Twitter::Error::Unauthorized
      tweet.update(twitter_id: 'Unauthorized')
    end
    #end
  end
end<commit_msg>add support for error code 64<commit_after>class TweeterWorker
  include Sidekiq::Worker

  def perform(tweet_id)
    tweet = Tweet.find(tweet_id)

    return if tweet.twitter_id.present?
    #tweet.with_lock do  Doesnt work with pgbouncer...
    #  next if tweet.twitter_id.present?

    sleep(tweet.scheduled_at - Time.now) while tweet.scheduled_at > Time.now

    begin
      tweet.send_tweet
    rescue Twitter::Error::Unauthorized
      tweet.update(twitter_id: 'Unauthorized')
    rescue Twitter::Error::Forbidden
      tweet.update(twitter_id: 'Forbidden')
    end
    #end
  end
end
{'fraction_non_alphanumeric': 0.0886426592797784, 'fraction_numerical': 0.0018467220683287165, 'mean_word_length': 3.353413654618474, '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': '5422850', 'n_tokens_mistral': 380, 'n_tokens_neox': 368, 'n_words': 78}