summaryrefslogtreecommitdiffstats
path: root/python/fatcat_worker.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-08 16:28:27 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-08 16:28:27 -0800
commit16f2e78298dbd2231f5f337ea17c89a6a131a052 (patch)
tree6e72581e625e73c97cbab72d0f9c35665c99e5d7 /python/fatcat_worker.py
parenteb40a5f274f3608db34309cfd16739a7642ef5e7 (diff)
parentffb721f90c5d97ee80885209bf45feb85ca9625c (diff)
downloadfatcat-16f2e78298dbd2231f5f337ea17c89a6a131a052.tar.gz
fatcat-16f2e78298dbd2231f5f337ea17c89a6a131a052.zip
Merge branch 'bnewbold-crude-auth'
Fixed a conflict in: python/fatcat_export.py
Diffstat (limited to 'python/fatcat_worker.py')
-rwxr-xr-xpython/fatcat_worker.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/python/fatcat_worker.py b/python/fatcat_worker.py
index e0ac48d8..0207fb19 100755
--- a/python/fatcat_worker.py
+++ b/python/fatcat_worker.py
@@ -1,28 +1,33 @@
#!/usr/bin/env python3
import sys
+import raven
import argparse
import datetime
+from fatcat_tools import public_api
from fatcat_tools.workers import ChangelogWorker, EntityUpdatesWorker, ElasticsearchReleaseWorker
+# Yep, a global. Gets DSN from `SENTRY_DSN` environment variable
+sentry_client = raven.Client()
+
def run_changelog(args):
topic = "fatcat-{}.changelog".format(args.env)
- worker = ChangelogWorker(args.api_host_url, args.kafka_hosts, topic,
- args.poll_interval)
+ worker = ChangelogWorker(args.api, args.kafka_hosts, topic,
+ poll_interval=args.poll_interval)
worker.run()
def run_entity_updates(args):
changelog_topic = "fatcat-{}.changelog".format(args.env)
release_topic = "fatcat-{}.release-updates".format(args.env)
- worker = EntityUpdatesWorker(args.api_host_url, args.kafka_hosts,
- changelog_topic, release_topic)
+ worker = EntityUpdatesWorker(args.api, args.kafka_hosts, changelog_topic,
+ release_topic=release_topic)
worker.run()
def run_elasticsearch_release(args):
consume_topic = "fatcat-{}.release-updates".format(args.env)
- worker = ElasticsearchReleaseWorker(args.kafka_hosts,
- consume_topic, elasticsearch_backend=args.elasticsearch_backend,
+ worker = ElasticsearchReleaseWorker(args.kafka_hosts, consume_topic,
+ elasticsearch_backend=args.elasticsearch_backend,
elasticsearch_index=args.elasticsearch_index)
worker.run()
@@ -64,6 +69,8 @@ def main():
if not args.__dict__.get("func"):
print("tell me what to do!")
sys.exit(-1)
+
+ args.api = public_api(args.api_host_url)
args.func(args)
if __name__ == '__main__':