services/synchronizer/lib/synchronizer/collection.rb
def enqueue_stalled
        stalled_threshold = Time.now + (3600 * 2)

        begin
          query = db.query(%Q(
              SELECT * FROM #{relation}
              WHERE EXTRACT(EPOCH FROM ran_at) < #{stalled_threshold.utc.to_f}
              AND state = '#{CartoDB::Synchronization::Member::STATE_SYNCING}'
            ))
          success = true
        rescue Exception => e
          success = false
          puts "ERROR fetching stalled sync tables: #{e.message}, #{e.backtrace}"
        end

        if success
          puts "Populating #{query.count} records after stalled fetch"
          hydrate(query).each { |record|
            puts "Enqueueing #{record.name} (#{record.id})"
            record.enqueue
          }
        end
      end
# Enqueues all syncs that got stalled (state syncing since too long).
# This happens when we push code while a sync is being performed.
Enqueues all syncs that got stalled (state syncing since too long).
This happens when we push code while a sync is being performed.
Enqueues all syncs that got stalled ( state syncing since too long ) . This happens when we push code while a sync is being performed .
def enqueue_stalled
        stalled_threshold = Time.now + (3600 * 2)
        begin
          query = db.query(%Q(
              SELECT * FROM #{relation}
              WHERE EXTRACT(EPOCH FROM ran_at) < #{stalled_threshold.utc.to_f}
              AND state = '#{CartoDB::Synchronization::Member::STATE_SYNCING}'
            ))
          success = true
        rescue Exception => e
          success = false
          puts "ERROR fetching stalled sync tables: #{e.message}, #{e.backtrace}"
        end
        if success
          puts "Populating #{query.count} records after stalled fetch"
          hydrate(query).each { |record|
            puts "Enqueueing #{record.name} (#{record.id})"
            record.enqueue
          }
        end
      end
def enqueue_stalled stalled_threshold = Time . now + ( 3600 * 2 ) begin query = db . query ( %Q(
              SELECT * FROM #{relation}
              WHERE EXTRACT(EPOCH FROM ran_at) < #{stalled_threshold.utc.to_f}
              AND state = '#{CartoDB::Synchronization::Member::STATE_SYNCING}'
            ) ) success = true rescue Exception => e success = false puts "ERROR fetching stalled sync tables: #{e.message}, #{e.backtrace}" end if success puts "Populating #{query.count} records after stalled fetch" hydrate ( query ) . each { | record | puts "Enqueueing #{record.name} (#{record.id})" record . enqueue } end end
Enqueues all syncs that got stalled (state syncing since too long).
Enqueues all syncs that got stalled ( state syncing since too long ) .