Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "defguard-client",
"private": false,
"version": "1.2.1",
"version": "1.2.2",
"type": "module",
"scripts": {
"dev": "npm-run-all --parallel vite typesafe-i18n",
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/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 src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ edition = "2021"
homepage = "https://github.com/DefGuard/client"
license-file = "../LICENSE.md"
rust-version = "1.80"
version = "1.2.1"
version = "1.2.2"

[package]
name = "defguard-client"
Expand Down
31 changes: 21 additions & 10 deletions src-tauri/src/periodic/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,28 @@ pub async fn verify_active_connections(app_handle: AppHandle) {
latest_stat.collected_at,
peer_alive_period,
) {
// Check if there was any traffic since the connection was established.
// If not, consider the location dead and disconnect it later without reconnecting.
// Check if there was any traffic since the connection was established
// If not and the connection was established longer than the peer_alive_period,
// consider the location dead and disconnect it later without reconnecting.
let time_since_connection = Utc::now() - con.start.and_utc();
if latest_stat.collected_at < con.start {
debug!(
"There wasn't any activity for Location {} since its \
connection at {}; considering it being dead and possibly \
broken. It will be disconnected without a further automatic \
reconnect.",
con.location_id, con.start
);
locations_to_disconnect.push((con.location_id, false));
if time_since_connection > peer_alive_period {
debug!(
"There wasn't any activity for Location {} since its \
connection at {}; considering it being dead and possibly \
broken. It will be terminated without a further automatic \
reconnect.",
con.location_id, con.start
);
locations_to_disconnect.push((con.location_id, false));
} else {
debug!(
"There wasn't any activity for Location {} since its \
connection at {}; The amount of time passed since the connection \
is {time_since_connection}, the connection will be terminated when it reaches \
{peer_alive_period}",
con.location_id, con.start);
}
} else {
debug!(
"There wasn't any activity for Location {} for the last \
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "defguard-client",
"version": "1.2.1"
"version": "1.2.2"
},
"tauri": {
"systemTray": {
Expand Down