Skip to content

Commit

Permalink
Create solutions topic on team creation
Browse files Browse the repository at this point in the history
This avoids a lot of spam in the console. Before this the topic would only
be created on the first solution submission, but if somebody would login to
the team managment page before the competition, rdkafka would throw a lot of
error of this missing topic.
  • Loading branch information
smrtrfszm committed Dec 15, 2023
1 parent e1dbca8 commit 94ef44d
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/handlers/team/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,18 @@ pub async fn create_team<S: StateTrait>(
state
.kafka_admin()
.create_topics(
&[NewTopic::new(
&topics::team_info(&result.last_insert_id),
1,
TopicReplication::Fixed(1),
)],
&[
NewTopic::new(
&topics::team_info(&result.last_insert_id),
1,
TopicReplication::Fixed(1),
),
NewTopic::new(
&topics::team_solutions(&result.last_insert_id),
1,
TopicReplication::Fixed(1),
),
],
&AdminOptions::new(),
)
.await?;
Expand Down

0 comments on commit 94ef44d

Please sign in to comment.