mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 02:35:31 +00:00
udp: replace dependency "chrono" with "time"
This commit is contained in:
parent
6197d120a6
commit
83987563ec
3 changed files with 28 additions and 5 deletions
24
Cargo.lock
generated
24
Cargo.lock
generated
|
|
@ -188,7 +188,6 @@ dependencies = [
|
||||||
"aquatic_toml_config",
|
"aquatic_toml_config",
|
||||||
"aquatic_udp_protocol",
|
"aquatic_udp_protocol",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"chrono",
|
|
||||||
"crossbeam-channel",
|
"crossbeam-channel",
|
||||||
"hex",
|
"hex",
|
||||||
"log",
|
"log",
|
||||||
|
|
@ -202,6 +201,7 @@ dependencies = [
|
||||||
"signal-hook",
|
"signal-hook",
|
||||||
"slab",
|
"slab",
|
||||||
"socket2 0.4.4",
|
"socket2 0.4.4",
|
||||||
|
"time 0.3.7",
|
||||||
"tinytemplate",
|
"tinytemplate",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -508,7 +508,7 @@ dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"num-integer",
|
"num-integer",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"time",
|
"time 0.1.43",
|
||||||
"winapi 0.3.9",
|
"winapi 0.3.9",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -1416,6 +1416,15 @@ dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "num_threads"
|
||||||
|
version = "0.1.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "aba1801fb138d8e85e11d0fc70baf4fe1cdfffda7c6cd34a854905df588e5ed0"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "number_prefix"
|
name = "number_prefix"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
|
|
@ -2044,6 +2053,17 @@ dependencies = [
|
||||||
"winapi 0.3.9",
|
"winapi 0.3.9",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "time"
|
||||||
|
version = "0.3.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "004cbc98f30fa233c61a38bc77e96a9106e65c88f2d3bef182ae952027e5753d"
|
||||||
|
dependencies = [
|
||||||
|
"itoa 1.0.1",
|
||||||
|
"libc",
|
||||||
|
"num_threads",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tinytemplate"
|
name = "tinytemplate"
|
||||||
version = "1.2.1"
|
version = "1.2.1"
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ aquatic_udp_protocol = "0.1.0"
|
||||||
|
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
cfg-if = "1"
|
cfg-if = "1"
|
||||||
chrono = "0.4"
|
|
||||||
crossbeam-channel = "0.5"
|
crossbeam-channel = "0.5"
|
||||||
hex = "0.4"
|
hex = "0.4"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
|
@ -36,6 +35,7 @@ serde = { version = "1", features = ["derive"] }
|
||||||
signal-hook = { version = "0.3" }
|
signal-hook = { version = "0.3" }
|
||||||
slab = "0.4"
|
slab = "0.4"
|
||||||
socket2 = { version = "0.4", features = ["all"] }
|
socket2 = { version = "0.4", features = ["all"] }
|
||||||
|
time = { version = "0.3", features = ["formatting"] }
|
||||||
tinytemplate = "1"
|
tinytemplate = "1"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,10 @@ use std::sync::Arc;
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
|
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use chrono::Utc;
|
|
||||||
use num_format::{Locale, ToFormattedString};
|
use num_format::{Locale, ToFormattedString};
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
use time::format_description::well_known::Rfc2822;
|
||||||
|
use time::OffsetDateTime;
|
||||||
use tinytemplate::TinyTemplate;
|
use tinytemplate::TinyTemplate;
|
||||||
|
|
||||||
use crate::common::*;
|
use crate::common::*;
|
||||||
|
|
@ -183,7 +184,9 @@ pub fn run_statistics_worker(config: Config, state: State) {
|
||||||
ipv6_active: config.network.ipv6_active(),
|
ipv6_active: config.network.ipv6_active(),
|
||||||
ipv4: statistics_ipv4,
|
ipv4: statistics_ipv4,
|
||||||
ipv6: statistics_ipv6,
|
ipv6: statistics_ipv6,
|
||||||
last_updated: Utc::now().to_rfc2822(),
|
last_updated: OffsetDateTime::now_utc()
|
||||||
|
.format(&Rfc2822)
|
||||||
|
.unwrap_or("(formatting error)".into()),
|
||||||
peer_update_interval: format!("{}", config.cleaning.torrent_cleaning_interval),
|
peer_update_interval: format!("{}", config.cleaning.torrent_cleaning_interval),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue