Skip to content

Commit 564f632

Browse files
committed
Only restore policy if needed
1 parent 2864e6d commit 564f632

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/sms/core/events_handler.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ async def clear_topics(self, *, topics: list[str], exclude_internal: bool = True
144144
if original_policy and "compact" in original_policy.split(","):
145145
await self._set_cleanup_policy(topic=topic, policy="delete")
146146
await asyncio.sleep(0.2) # brief pause to wait for policy changes
147+
else:
148+
original_policy = None # don't need to revert 'delete' topics
147149

148150
records_to_delete = {
149151
TopicPartition(

0 commit comments

Comments
 (0)