Skip to content

Commit

Permalink
small mqtt subscriber changes
Browse files Browse the repository at this point in the history
  • Loading branch information
juuwel committed Jun 5, 2024
1 parent 5e703f1 commit 6f9fa80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/Core/Services/MqttSubscriberService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,7 @@ public async Task SubscribeAsync()
f => { f.WithTopic(_options.Value.SubscribeTopic); }).Build();

await mqttClient.SubscribeAsync(mqttSubscribeOptions, CancellationToken.None);

Console.ReadLine();
}
}
1 change: 1 addition & 0 deletions api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public static async Task<WebApplication> StartApi(string[] args)
var services = builder.FindAndInjectClientEventHandlers(Assembly.GetExecutingAssembly());

var app = builder.Build();
await app.Services.GetRequiredService<MqttSubscriberService>().SubscribeAsync();

// be careful with using --db-init on production, it will delete all data
if (args.Contains("--db-init"))
Expand Down

0 comments on commit 6f9fa80

Please sign in to comment.