Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:CenterForOpenScience/SHARE into …
Browse files Browse the repository at this point in the history
…develop
  • Loading branch information
aaxelb committed Jan 5, 2018
2 parents da6cd9a + e3ae416 commit f5c2a5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,8 @@ def split(string, delim):
SHARE_USER_AGENT = os.environ.get('SHARE_USER_AGENT', 'SHAREbot/{} (+{})'.format(VERSION, SHARE_WEB_URL))

OSF_API_URL = os.environ.get('OSF_API_URL', 'https://staging-api.osf.io').rstrip('/') + '/'
OSF_BYPASS_THROTTLE_TOKEN = os.environ.get('BYPASS_THROTTLE_TOKEN', None)

DOI_BASE_URL = os.environ.get('DOI_BASE_URL', 'http://dx.doi.org/')

ALLOWED_TAGS = ['abbr', 'acronym', 'b', 'blockquote', 'code', 'em', 'i', 'li', 'ol', 'strong', 'ul']
Expand Down
4 changes: 4 additions & 0 deletions share/harvesters/io_osf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ class OSFHarvester(BaseHarvester):
VERSION = 1

def build_url(self, start_date, end_date):
# so prod SHARE doesn't get throttled
if settings.OSF_BYPASS_THROTTLE_TOKEN:
self.session.headers.update({'X-THROTTLE-TOKEN': settings.OSF_BYPASS_THROTTLE_TOKEN})

url = furl(settings.OSF_API_URL + self.kwargs['path'])
url.args['page[size]'] = 100
# url.args['filter[public]'] = 'true'
Expand Down

0 comments on commit f5c2a5c

Please sign in to comment.