Skip to content

Commit d7e9024

Browse files
committed
Raise an exception in AzulClient index methods when bundle notifications are disabled
1 parent 8d42271 commit d7e9024

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/azul/azulclient.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ def mirror_source_message(self,
128128
)
129129

130130
def local_reindex(self, catalog: CatalogName, prefix: str) -> int:
131+
if not config.enable_bundle_notifications:
132+
raise AzulClientError('Bundle notifications are disabled')
131133
service = self.index_repository_service
132134
notifications: JSONs = [
133135
# Notifications sent organically by DSS had a different structure,
@@ -148,6 +150,8 @@ def index(self,
148150
notifications: Iterable[JSON],
149151
delete: bool = False
150152
):
153+
if not config.enable_bundle_notifications:
154+
raise AzulClientError('Bundle notifications are disabled')
151155
errors = defaultdict[int, int](int)
152156
missing = []
153157
indexed = 0

0 commit comments

Comments
 (0)