Skip to content

Commit

Permalink
limited rollout of #456: only run for @kylewm and me, extra logging
Browse files Browse the repository at this point in the history
  • Loading branch information
snarfed committed Sep 14, 2015
1 parent a579951 commit c4adc85
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions original_post_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ def discover(source, activity, fetch_hfeed=True, include_redirect_sources=True):
obj = activity.get('object') or activity
author_id = obj.get('author', {}).get('id')
if author_id and author_id != source.user_tag_id():
logging.warning(
"Demoting original post links because user %s doesn't match author of %s",
source.user_tag_id(), activity)
# this is someone else's post, so all links must be mentions
mentions.update(originals)
originals = set()
Expand Down
5 changes: 3 additions & 2 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,9 @@ def poll(self, source):
response = source.get_activities_response(**kwargs)
activities += response.get('items', [])
for domain in source.domains:
activities += source.get_activities_response(
search_query='"%s"' % domain, **kwargs).get('items', [])
if appengine_config.DEBUG or domain in util.LOCALHOST_TEST_DOMAINS:
activities += source.get_activities_response(
search_query='"%s"' % domain, **kwargs).get('items', [])
except NotImplementedError:
# this source doesn't support search
pass
Expand Down

0 comments on commit c4adc85

Please sign in to comment.