Changeset 1591

Show
Ignore:
Timestamp:
05/27/08 17:23:45 (6 months ago)
Author:
mbriggs
Message:

Attempting to prevent queue_url collisions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • hive/trunk/data_webapp/app/controllers/hc_database_controller.rb

    r1587 r1591  
    1313  def insert(type,obj_hash) 
    1414    obj = type.new_from_hash(obj_hash) 
     15    sleep 15 
    1516    if obj.nil? 
    1617      return 0  
     
    5960      } 
    6061      # Counts the number of urls successfully inserted OR modified 
    61       if insert(QueueUrl,url_obj) 
    62         count += 1 
     62      while true 
     63        begin 
     64          if insert(QueueUrl,url_obj) 
     65            count += 1 
     66            break 
     67          end 
     68        rescue 
     69          break if $!.to_s.index('Duplicate entry').nil? 
     70        end 
    6371      end 
    6472    end