File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 33(defn dissoc-internal
44 " Dissocs the context keys that shouldn't be carried over to further processing."
55 [context]
6- (let [removed-keys #{:processor :url :skyscraper.core/new-items :skyscraper.core/retry }]
6+ (let [removed-keys #{:processor :url :skyscraper.core/new-items :skyscraper.core/retry
7+ :skyscraper/description :skyscraper.traverse/priority }]
78 (into {}
89 (remove (fn [[k _]] (or (contains? removed-keys k)
910 (and (keyword? k)
2425 :skyscraper.core/stage
2526 :skyscraper.traverse/handler
2627 :skyscraper.traverse/call-protocol
28+ :skyscraper.traverse/priority
29+ :skyscraper/description
2730 :http/cookies ))
2831
2932(defn describe
3841 true (merge (select-keys context [:processor :url ])) ; reattach
3942 processor (assoc :skyscraper.core/current-processor-name (:name processor))
4043 true pr-str)))
44+
45+ (defn describe-url
46+ [context]
47+ (or (:skyscraper/description context)
48+ (:url context)))
Original file line number Diff line number Diff line change 378378 (let [req (merge {:method :get , :url (:url context)}
379379 (extract-namespaced-keys " http" context))
380380 success-fn (fn [response]
381- (debugf " [download] Downloaded %s" (: url context))
381+ (debugf " [download] Downloaded %s" (context/describe- url context))
382382 (.release download-semaphore)
383383 (callback (respond-with response options context)))
384384 error-fn (fn [error]
387387 (callback (error-handler error options context))))]
388388 (debugf " [download] Waiting" )
389389 (.acquire download-semaphore)
390- (infof " [download] Downloading %s" (: url context))
390+ (infof " [download] Downloading %s" (context/describe- url context))
391391 (let [req (merge {:async? true ,
392392 :connection-manager connection-manager}
393393 req (get-option context options :http-options ))
407407 request-fn (or (:request-fn options)
408408 http/request)]
409409 (try
410- (infof " [download] Downloading %s" (: url context))
410+ (infof " [download] Downloading %s" (context/describe- url context))
411411 (wait sleep)
412412 (let [resp (request-fn req)]
413- (debugf " [download] Downloaded %s" (: url context))
413+ (debugf " [download] Downloaded %s" (context/describe- url context))
414414 [(cond-> (advance-pipeline pipeline context)
415415 true (assoc ::response resp)
416416 (:cookies resp) (update :http/cookies merge (:cookies resp)))])
You can’t perform that action at this time.
0 commit comments