Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9345593
D4670.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D4670.diff
View Options
diff --git a/swh/search/cli.py b/swh/search/cli.py
--- a/swh/search/cli.py
+++ b/swh/search/cli.py
@@ -62,8 +62,14 @@
default=["origin", "origin_visit"],
help="Default list of object types to subscribe to",
)
+@click.option(
+ "--prefix",
+ "-p",
+ default="swh.journal.objects",
+ help="Topic prefix to use (e.g swh.journal.indexed)",
+)
@click.pass_context
-def journal_client_objects(ctx, stop_after_objects, object_type):
+def journal_client_objects(ctx, stop_after_objects, object_type, prefix):
"""Listens for new objects from the SWH Journal, and schedules tasks
to run relevant indexers (currently, origin and origin_visit)
on these new objects.
@@ -80,6 +86,7 @@
journal_cfg = config["journal"]
object_types = object_type or journal_cfg.get("object_types")
+ prefix = prefix or journal_cfg.get("prefix")
client = get_journal_client(
cls="kafka",
diff --git a/swh/search/tests/test_cli.py b/swh/search/tests/test_cli.py
--- a/swh/search/tests/test_cli.py
+++ b/swh/search/tests/test_cli.py
@@ -76,6 +76,8 @@
"1",
"--object-type",
"origin",
+ "--prefix",
+ kafka_prefix,
],
journal_objects_config,
elasticsearch_host=elasticsearch_host,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 3, 3:26 PM (1 w, 19 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3231947
Attached To
D4670: cli: Allow topic prefix declaration through cli or configuration
Event Timeline
Log In to Comment