feat: switch over to using tokio
This commit is contained in:
parent
faa6233ecb
commit
9178a16f95
5 changed files with 18 additions and 16 deletions
26
Cargo.lock
generated
26
Cargo.lock
generated
|
@ -101,16 +101,6 @@ version = "0.5.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
|
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "async-attributes"
|
|
||||||
version = "1.1.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5"
|
|
||||||
dependencies = [
|
|
||||||
"quote",
|
|
||||||
"syn 1.0.109",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-channel"
|
name = "async-channel"
|
||||||
version = "1.8.0"
|
version = "1.8.0"
|
||||||
|
@ -265,7 +255,6 @@ version = "1.12.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d"
|
checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-attributes",
|
|
||||||
"async-channel",
|
"async-channel",
|
||||||
"async-global-executor",
|
"async-global-executor",
|
||||||
"async-io",
|
"async-io",
|
||||||
|
@ -1836,6 +1825,16 @@ dependencies = [
|
||||||
"libm",
|
"libm",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "num_cpus"
|
||||||
|
version = "1.16.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43"
|
||||||
|
dependencies = [
|
||||||
|
"hermit-abi",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "once_cell"
|
name = "once_cell"
|
||||||
version = "1.17.1"
|
version = "1.17.1"
|
||||||
|
@ -2575,7 +2574,6 @@ dependencies = [
|
||||||
name = "skynet_ldap_backend"
|
name = "skynet_ldap_backend"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-std",
|
|
||||||
"chrono",
|
"chrono",
|
||||||
"dotenvy",
|
"dotenvy",
|
||||||
"ldap3",
|
"ldap3",
|
||||||
|
@ -2586,6 +2584,7 @@ dependencies = [
|
||||||
"sqlx",
|
"sqlx",
|
||||||
"ssh-key",
|
"ssh-key",
|
||||||
"tide",
|
"tide",
|
||||||
|
"tokio",
|
||||||
"wolves_oxidised",
|
"wolves_oxidised",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -3161,7 +3160,10 @@ dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"libc",
|
"libc",
|
||||||
"mio",
|
"mio",
|
||||||
|
"num_cpus",
|
||||||
|
"parking_lot",
|
||||||
"pin-project-lite 0.2.9",
|
"pin-project-lite 0.2.9",
|
||||||
|
"signal-hook-registry",
|
||||||
"socket2 0.4.9",
|
"socket2 0.4.9",
|
||||||
"tokio-macros",
|
"tokio-macros",
|
||||||
"windows-sys 0.48.0",
|
"windows-sys 0.48.0",
|
||||||
|
|
|
@ -19,7 +19,7 @@ dotenvy = "0.15.7"
|
||||||
|
|
||||||
# For tide
|
# For tide
|
||||||
tide = "0.16.0"
|
tide = "0.16.0"
|
||||||
async-std = { version = "1.12.0", features = ["attributes"] }
|
tokio = { version = "1", features = ["macros", "rt-multi-thread", "full"] }
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
|
|
||||||
# For sqlite
|
# For sqlite
|
||||||
|
|
|
@ -3,7 +3,7 @@ use skynet_ldap_backend::{db_init, get_config, AccountWolves, Accounts, Config};
|
||||||
use sqlx::{Pool, Sqlite};
|
use sqlx::{Pool, Sqlite};
|
||||||
use wolves_oxidised::WolvesUser;
|
use wolves_oxidised::WolvesUser;
|
||||||
|
|
||||||
#[async_std::main]
|
#[tokio::main]
|
||||||
async fn main() -> tide::Result<()> {
|
async fn main() -> tide::Result<()> {
|
||||||
let config = get_config();
|
let config = get_config();
|
||||||
let db = db_init(&config).await.unwrap();
|
let db = db_init(&config).await.unwrap();
|
||||||
|
|
|
@ -2,7 +2,7 @@ use skynet_ldap_backend::{db_init, get_config, get_now_iso, get_wolves, update_g
|
||||||
use sqlx::{Pool, Sqlite};
|
use sqlx::{Pool, Sqlite};
|
||||||
use std::{collections::HashSet, env, error::Error};
|
use std::{collections::HashSet, env, error::Error};
|
||||||
|
|
||||||
#[async_std::main]
|
#[tokio::main]
|
||||||
async fn main() -> tide::Result<()> {
|
async fn main() -> tide::Result<()> {
|
||||||
let config = get_config();
|
let config = get_config();
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ use tide::{
|
||||||
security::{CorsMiddleware, Origin},
|
security::{CorsMiddleware, Origin},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[async_std::main]
|
#[tokio::main]
|
||||||
async fn main() -> tide::Result<()> {
|
async fn main() -> tide::Result<()> {
|
||||||
let config = get_config();
|
let config = get_config();
|
||||||
let db = db_init(&config).await?;
|
let db = db_init(&config).await?;
|
||||||
|
|
Loading…
Add table
Reference in a new issue