Skip to content

Commit

Permalink
Merge pull request #39 from mxmgorin/fix-publish-with-auto-create
Browse files Browse the repository at this point in the history
Fix publish with auto create topic
  • Loading branch information
amigin authored Jan 20, 2025
2 parents 83791bd + 0f18c93 commit 0cfdae4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/operations/publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ pub async fn publish(
return Err(OperationFailResult::ShuttingDown);
}

let topic = app.topic_list.get(topic_id).await;
let mut topic = app.topic_list.get(topic_id).await;

if topic.is_none() {
if app.settings.auto_create_topic_on_publish {
app.topic_list.add_if_not_exists(topic_id).await?;
topic = Some(app.topic_list.add_if_not_exists(topic_id).await?);
} else {
return Err(OperationFailResult::TopicNotFound {
topic_id: topic_id.to_string(),
Expand Down

0 comments on commit 0cfdae4

Please sign in to comment.