Skip to content

Commit

Permalink
second fix
Browse files Browse the repository at this point in the history
  • Loading branch information
htcfreek committed Apr 3, 2022
1 parent 3e1ffa0 commit f702d32
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ internal static List<Result> GetNetworkConnectionResults(string iconTheme, Cultu
var results = new List<Result>();

// We update the cache only if the last query is older than 'updateCacheIntervalSeconds' seconds
if ((DateTime.Now - timeOfLastNetworkQuery).TotalSeconds >= UpdateCacheIntervalSeconds)
DateTime timeOfLastNetworkQueryBefore = timeOfLastNetworkQuery;
timeOfLastNetworkQuery = DateTime.Now; // Set time of last query to this query
if ((timeOfLastNetworkQuery - timeOfLastNetworkQueryBefore).TotalSeconds >= UpdateCacheIntervalSeconds)
{
networkPropertiesCache = NetworkConnectionProperties.GetList();
}
Expand Down Expand Up @@ -206,9 +208,6 @@ internal static List<Result> GetNetworkConnectionResults(string iconTheme, Cultu
}
}

// Set time of last query
timeOfLastNetworkQuery = DateTime.Now;

return results;
}
}
Expand Down

0 comments on commit f702d32

Please sign in to comment.