From 5895bb7d5688e3d16edd58b1299a351184b76942 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Wed, 25 Jan 2023 08:56:14 +0100 Subject: [PATCH] async mutex --- Cargo.lock | 4 +++- Cargo.toml | 2 ++ src/main.rs | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d74c851..eedf9d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -961,6 +961,7 @@ dependencies = [ "reqwest", "serde", "serde_json", + "tokio", "web-base", ] @@ -1801,12 +1802,13 @@ checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" [[package]] name = "web-base" version = "0.1.0" -source = "git+https://git.hydrar.de/jmarya/web-base#4ac976ed197f9feefa577e02c0f9c810f0623ee2" +source = "git+https://git.hydrar.de/jmarya/web-base#0920a1fcbc15c4ec5bbf131103e98e44cb2a0968" dependencies = [ "actix-files", "actix-web", "maud", "reqwest", + "tokio", "url", "uuid", ] diff --git a/Cargo.toml b/Cargo.toml index e280b77..c60c8ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,3 +17,5 @@ serde = {version = "1.0.147", features = ["derive"] } serde_json = "1.0.87" reqwest = "0.11" maud = "0.24.0" +tokio = { version = "1", features = ["sync"] } + diff --git a/src/main.rs b/src/main.rs index 296bd22..da4602c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,8 @@ mod msg; mod notification; mod pages; -use std::sync::{Arc, Mutex}; +use std::sync::Arc; +use tokio::sync::Mutex; use actix_web::*;