aboutsummaryrefslogtreecommitdiffstats
path: root/fatcat_scholar
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-10-19 19:13:59 -0700
committerBryan Newbold <bnewbold@archive.org>2020-10-19 19:13:59 -0700
commitbc641c8d9f52867ed7b25015fd7c359fff32582a (patch)
treef98a32b0b66e4cd86cb222aa9fd735a80c75871d /fatcat_scholar
parentf798d4b050ed9831eacf48ceb586d7925ea2891e (diff)
downloadfatcat-scholar-bc641c8d9f52867ed7b25015fd7c359fff32582a.tar.gz
fatcat-scholar-bc641c8d9f52867ed7b25015fd7c359fff32582a.zip
issue-db: use dynaconf settings
Diffstat (limited to 'fatcat_scholar')
-rw-r--r--fatcat_scholar/issue_db.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/fatcat_scholar/issue_db.py b/fatcat_scholar/issue_db.py
index ba88d07..e50ae9f 100644
--- a/fatcat_scholar/issue_db.py
+++ b/fatcat_scholar/issue_db.py
@@ -8,6 +8,8 @@ import fatcat_openapi_client
import elasticsearch
from elasticsearch_dsl import Search
+from fatcat_scholar.config import settings
+
@dataclass
class SimPubRow:
@@ -122,6 +124,7 @@ def es_issue_count(
.filter("term", issue=issue)
.extra(request_cache=True)
)
+ search = search.params(request_cache='true')
return search.count()
@@ -378,7 +381,7 @@ def main() -> None:
parser.add_argument(
"--db-file",
help="sqlite3 database file to open",
- default="data/issue_db.sqlite",
+ default=settings.SCHOLAR_ISSUEDB_PATH,
type=str,
)
@@ -421,7 +424,7 @@ def main() -> None:
idb = IssueDB(args.db_file)
api = fatcat_openapi_client.DefaultApi(fatcat_openapi_client.ApiClient())
- es_client = elasticsearch.Elasticsearch("https://search.fatcat.wiki")
+ es_client = elasticsearch.Elasticsearch(settings.FATCAT_ELASTICSEARCH_BACKEND)
if args.func == "load_pubs":
idb.load_pubs(args.json_file, api)