From 6b68f2139602acdd5d9985812353130759f2a6ce Mon Sep 17 00:00:00 2001 From: IJ Kim Date: Tue, 14 Apr 2015 16:18:13 -0400 Subject: [PATCH] querying only 2 months opportunities after getting 'Request Entity Too Large' --- lib/sf/account.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sf/account.rb b/lib/sf/account.rb index 693d972..741169a 100644 --- a/lib/sf/account.rb +++ b/lib/sf/account.rb @@ -89,13 +89,13 @@ def self.intl_partner?(account_id) # It looks up for the past one year def self.inc_parts_to_be - acct_ids = Sf::Opportunity.inc_participations(Date.today.prev_month(12)).map(&:AccountId) + acct_ids = Sf::Opportunity.inc_participations(Date.today.prev_month(2)).map(&:AccountId) accts_str = acct_ids.map{|v| "\'#{v}\'"}.join(', ') build_collection Sf.client.query("select #{FIELDS_SELECT_STR} from Account where InCommon_Participant__c != true and Id in (#{accts_str})") end def self.inc_certs_to_be - acct_ids = Sf::Opportunity.cert_subscribers(Date.today.prev_month(12)).map(&:AccountId) + acct_ids = Sf::Opportunity.cert_subscribers(Date.today.prev_month(2)).map(&:AccountId) accts_str = acct_ids.map{|v| "\'#{v}\'"}.join(', ') build_collection Sf.client.query("select #{FIELDS_SELECT_STR} from Account where InCommon_Participant__c = true and Id in (#{accts_str})") end