mirror of
https://github.com/Djeeberjr/fw-anwesenheit.git
synced 2026-04-30 18:49:09 +00:00
use the tokio fs in id store
außerdem "readed_string" also bitte
This commit is contained in:
@@ -58,7 +58,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
||||
|
||||
let raw_store = if fs::try_exists(STORE_PATH).await? {
|
||||
info!("Loading data from file");
|
||||
IDStore::new_from_json(STORE_PATH)?
|
||||
IDStore::new_from_json(STORE_PATH).await?
|
||||
} else {
|
||||
info!("No data file found. Creating empty one.");
|
||||
IDStore::new()
|
||||
@@ -77,7 +77,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
||||
info!("Added new id to current day");
|
||||
// TODO: trigger the buzzer
|
||||
|
||||
if let Err(e) = channel_store.lock().await.export_json(STORE_PATH) {
|
||||
if let Err(e) = channel_store.lock().await.export_json(STORE_PATH).await {
|
||||
error!("Failed to save id store to file: {}", e);
|
||||
// TODO: How to handle a failure to save ?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user