Skip to content

Fixed check streams after restart. Stream will not try to create new …#21

Closed
Ruslan-Droid wants to merge 2 commits intotaskiq-python:masterfrom
Ruslan-Droid:fix-streams-in-nats
Closed

Fixed check streams after restart. Stream will not try to create new …#21
Ruslan-Droid wants to merge 2 commits intotaskiq-python:masterfrom
Ruslan-Droid:fix-streams-in-nats

Conversation

@Ruslan-Droid
Copy link
Copy Markdown

When we start worker and code with broker that using streams it trying to create new stream every time. Added check if stream created. If not it will be created

Comment thread taskiq_nats/broker.py Outdated
result_backend: "typing.Optional[AsyncResultBackend[_T]]" = None,
task_id_generator: typing.Optional[typing.Callable[[], str]] = None,
**connection_kwargs: typing.Any,
self,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this unnessesary chanes with additional spaces

(I wonder why pre-commit hooks or CI checks didn't catch this...)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I've corrected it.

Removed extra spaces from the code
@Ruslan-Droid Ruslan-Droid closed this by deleting the head repository Jan 21, 2026
@Bartr4
Copy link
Copy Markdown

Bartr4 commented Mar 10, 2026

Hi @Ruslan-Droid and @danfimov ,

I've been running into a startup crash where add_stream fails with err_code=10058 ("stream name already in use with a different configuration") when the stream already exists and the configuration was enriched by my NATS production server. This PR seems to address that by adding an existence check before attempting to create the stream.

Would you be willing to reopen or resubmit this fix? I'd be happy to contribute if that helps move it forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants