Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
maksimryndin committed Jul 28, 2024
1 parent 6d1341d commit f92f0f0
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 85 deletions.
88 changes: 9 additions & 79 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ getrandom = "0.2"
google-sheets4 = "*"
http = "0.2"
hyper = { version = "0.14", features = ["http1", "http2", "client", "server"]} # using the same version as google-sheets4
hyper-rustls = "0.24"
hyper-rustls = "0.25"
lazy_static = "1.4"
prometheus-parse = "0.2.4"
regex = { version = "1", features = ["std", "unicode"] } # use the same version as current crates
Expand Down
1 change: 1 addition & 0 deletions src/google/spreadsheet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ impl SpreadsheetAPI {
hyper::Client::builder().build(
hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.expect("assert: can build sheets client with native root certs")
.https_only()
.enable_http1()
.build(),
Expand Down
1 change: 1 addition & 0 deletions src/messenger/discord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ impl Discord {
let client: HttpsClient = hyper::Client::builder().build(
hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.expect("assert: can build discord client with native root certs")
.https_only()
.enable_http1()
.build(),
Expand Down
1 change: 1 addition & 0 deletions src/messenger/slack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ impl Slack {
let client: HttpsClient = hyper::Client::builder().build(
hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.expect("assert: can build slack client with native root certs")
.https_only()
.enable_http1()
.build(),
Expand Down
1 change: 1 addition & 0 deletions src/messenger/telegram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ impl Telegram {
let client: HttpsClient = hyper::Client::builder().build(
hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.expect("assert: can build telegram client with native root certs")
.https_only()
.enable_http1()
.build(),
Expand Down
1 change: 1 addition & 0 deletions src/services/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ impl HttpClient {
.build(
hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.expect("assert: can build http client with native root certs")
.https_or_http()
.enable_http1()
.build(),
Expand Down
12 changes: 7 additions & 5 deletions src/services/system/collector.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::google::datavalue::{Datarow, Datavalue};
use crate::notifications::{Notification, Sender};
use chrono::NaiveDateTime;
use chrono::{DateTime, NaiveDateTime};
use std::path::Path;
use std::thread;
use std::time::Duration;
Expand Down Expand Up @@ -72,14 +72,15 @@ impl ProcessInfo {
memory_use: (100.0 * sysinfo_process.memory() as f64 / total_memory as f64) as f32,
disk_read: sysinfo_process.disk_usage().read_bytes,
disk_write: sysinfo_process.disk_usage().written_bytes,
start_time: NaiveDateTime::from_timestamp_opt(
start_time: DateTime::from_timestamp(
sysinfo_process
.start_time()
.try_into()
.expect("assert: it is possible to build datetime from process start time"),
0,
)
.expect("assert: process start_time timestamp should be valid"),
.expect("assert: process start_time timestamp should be valid")
.naive_local(),
open_files: open_files(sysinfo_process.pid()),
}
}
Expand Down Expand Up @@ -228,13 +229,14 @@ pub(super) fn collect(
processes_infos.push(ProcessInfo::from(p, total_memory));
}

let boot_time = NaiveDateTime::from_timestamp_opt(
let boot_time = DateTime::from_timestamp(
System::boot_time()
.try_into()
.expect("assert: it is possible to build datetime from system boot time"),
0,
)
.expect("assert: system boot time timestamp should be valid");
.expect("assert: system boot time timestamp should be valid")
.naive_local();
let basic = [
(
MEMORY_USE.to_string(),
Expand Down

0 comments on commit f92f0f0

Please sign in to comment.