From b7afa91cc0b1600f33f9e1fe138dc032cca163f3 Mon Sep 17 00:00:00 2001 From: Ryan Lue Date: Thu, 23 Apr 2020 12:51:23 +0800 Subject: [PATCH] Refactoring: Remove unused method --- lib/twitter_sync.rb | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/lib/twitter_sync.rb b/lib/twitter_sync.rb index 47b89220f..7e7307d45 100644 --- a/lib/twitter_sync.rb +++ b/lib/twitter_sync.rb @@ -573,19 +573,6 @@ create a tweet or direct message from an article false end - def direct_message_limit_reached(tweet, factor = 1) - max_count = 100 - max_count = max_count * factor - type_id = Ticket::Article::Type.lookup(name: 'twitter direct-message').id - created_at = Time.zone.now - 15.minutes - created_count = Ticket::Article.where('created_at > ? AND type_id = ?', created_at, type_id).count - if created_count > max_count - Rails.logger.info "Tweet direct message limit reached #{created_count}/#{max_count}, ignored tweed id (#{tweet.id})" - return true - end - false - end - =begin replace Twitter::Place and Twitter::Geo as hash and replace Twitter::NullObject with nil