mirror of
https://git.alemi.dev/dashboard.git
synced 2024-11-12 19:29:18 +01:00
fix: don't crash when closing before connecting to anything
This commit is contained in:
parent
0ce377ed6d
commit
35f1675a00
1 changed files with 4 additions and 1 deletions
|
@ -320,7 +320,10 @@ impl AppState {
|
||||||
|
|
||||||
pub async fn worker(mut self, run:watch::Receiver<bool>) {
|
pub async fn worker(mut self, run:watch::Receiver<bool>) {
|
||||||
let mut now;
|
let mut now;
|
||||||
let first_db_uri = self.db_uri.recv().await.unwrap();
|
let Some(first_db_uri) = self.db_uri.recv().await else {
|
||||||
|
warn!(target: "state-manager", "No initial database URI, skipping first connection");
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
let mut db = Database::connect(first_db_uri.clone()).await.unwrap();
|
let mut db = Database::connect(first_db_uri.clone()).await.unwrap();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue