Changeset 1519

Show
Ignore:
Timestamp:
04/16/08 13:06:28 (4 weeks ago)
Author:
mbriggs
Message:

Fixed source problems in insert_history_url

Files:

Legend:

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

    r1501 r1519  
    8080    hid = client.host_id 
    8181     
    82     # Get source information 
    83     stype = obj_hash.delete("source_type") or "unknown" 
    84     sname = obj_hash.delete("source_name") 
     82    #XXX: Get source information 
     83    #stype = obj_hash.delete("source_type") or "unknown" 
     84    #sname = obj_hash.delete("source_name") 
    8585 
    8686    bee_work = {"cid" => client.cid, "urls" => []} 
     
    9393      # Build URL history item and insert. 
    9494      obj_hash[l].each do |u,t| 
     95 
    9596        url_obj = { 
    9697          "url" => u, 
     
    9899          "status" => l.gsub("links_",""), 
    99100          "client_id" => cid, 
    100           "source_type" => stype, 
    101           "source_name" => sname, 
    102101        } 
     102        q = QueueUrl.find(:first,:conditions => {:url => u}) 
     103        if not q.nil? 
     104          url_obj["source_type"] = (q.source_type or "unknown") 
     105          url_obj["source_name"] = q.source_name 
     106        end 
    103107         
    104108        # Prevent duplication of history items due to