Permalink
Browse files

Make the rescrape API work with the caching media scraper

This is a temporary workaround until a new scraper_q request message
type is added that forces a rescrape regardless of the current cache
state.
  • Loading branch information...
1 parent 6cfa691 commit 34fd7f89ca32edf9cdd0289f6e5f09cf5b858928 @ehrmann ehrmann committed Feb 12, 2014
Showing with 5 additions and 0 deletions.
  1. +5 −0 r2/r2/controllers/api.py
View
5 r2/r2/controllers/api.py
@@ -1202,6 +1202,11 @@ def POST_rescrape(self, thing):
if not isinstance(thing, Link):
return
+ # KLUDGE: changing the cache entry to a placeholder for this URL will
+ # cause the media scraper to force a rescrape. This will be fixed
+ # when parameters can be passed to the scraper queue.
+ media_cache.MediaByURL.add_placeholder(thing.url, autoplay=False)
+
amqp.add_item("scraper_q", thing._fullname)
@require_oauth2_scope("modposts")

0 comments on commit 34fd7f8

Please sign in to comment.