From 8bdc62314a970d27f6aef86adc427186e421ca08 Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Fri, 11 Oct 2013 10:58:29 -0700 Subject: [PATCH] scraper_q: Gracefully degrade to thumbnail-only when no embedly. Between the local filesystem media provider and this change, scraper_q is workable after a default install now. --- install-reddit.sh | 2 +- r2/r2/lib/media.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/install-reddit.sh b/install-reddit.sh index 739962f0a..2f37617ab 100755 --- a/install-reddit.sh +++ b/install-reddit.sh @@ -483,7 +483,7 @@ function set_consumer_count { set_consumer_count log_q 0 set_consumer_count cloudsearch_q 0 -set_consumer_count scraper_q 0 +set_consumer_count scraper_q 1 set_consumer_count commentstree_q 1 set_consumer_count newcomments_q 1 set_consumer_count vote_link_q 1 diff --git a/r2/r2/lib/media.py b/r2/r2/lib/media.py index 0f4a48d94..a42fb2c42 100644 --- a/r2/r2/lib/media.py +++ b/r2/r2/lib/media.py @@ -504,6 +504,10 @@ def _fetch_embedly_service_data(): def _fetch_embedly_services(): + if not g.embedly_api_key: + g.log.warning("No embedly_api_key configured. Will not use embed.ly.") + return [] + service_data = _fetch_embedly_service_data() services = []