This repository has been archived by the owner on Mar 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
config.py
69 lines (56 loc) · 2.16 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
"""Application-specific settings and configuration to
dictate the behavior of the API.
"""
import os
cache = {
"front_page": 600,
"simple": 7200,
"paper": 604800, # 1 week
"author": 604800 # 1 week
}
# For the "summary statistics" endpoint, the download metrics
# for a given month are hidden until X days after the month has
# ended, because those numbers could lag weeks behind the calendar
# date. This setting indicates how many days should elapse before
# a month's download numbers should be included.
summary_download_age = 14
# Information about how to connect to a postgres database will
# all the Rxivist data
db = {
"host": os.environ['RX_DBHOST'],
"db": "rxdb",
"user": os.environ['RX_DBUSER'],
"password": os.environ['RX_DBPASSWORD'],
"schema": 'prod', # Each environment has a schema, theoretically
"connection": {
"timeout": 3,
"max_attempts": 10,
"attempt_pause": 3, # how long to wait between connection attempts
},
}
# Hostname (and protocol) where users will find your site.
# This is needed to build redirect URLs that don't
# break when the web server is behind a reverse proxy.
host = "https://api.url_goes_in_here.org"
# Whether to launch the application with gunicorn as the web server, or
# with Bottle's default. The default can be handy for development because
# it includes the option to reload the application any time there is a
# code change.
use_prod_webserver = True
# how many search results are returned at a time
default_page_size = 20
# the most results an API user can request at one time
max_page_size = 250
# Amount of time that can pass since an article has been updated before
# it is included in the tally of "outdated" articles
outdated_limit = "4 weeks"
# When displaying a leaderboard of author rankings, how many names should appear
author_ranks_limit = 200
# When a user requests daily twitter metrics, this is the
# minimum number of papers we need results for before it's
# automatically rolled over to "weekly"
min_daily_twitter = 10
# When a user requests WEEKLY twitter metrics, this is the
# minimum number of papers we need results for before it's
# rolled over to downloads instead
min_weekly_twitter = 250