From e14cf93d921e462e9ed5138ae1f4019d9f79a9f3 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sat, 10 Jun 2017 01:01:54 +0200 Subject: Windows: reduce WNetGetConnection performance impact by making calls every 1 minute instead of every 2 seconds. This should be enough since the list of mapped network drive will not change so often. --- src/Common/Dlgcode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Common/Dlgcode.c') diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c index 33e02514..f21d551f 100644 --- a/src/Common/Dlgcode.c +++ b/src/Common/Dlgcode.c @@ -7154,8 +7154,8 @@ DWORD GetUsedLogicalDrives (void) finally_do ({ LeaveCriticalSection (&csWNetCalls); }); - /* update values every 2 seconds to reduce CPU consumption */ - if ((time (NULL) - g_lastCallTime) > 2) + /* update values every 1 minute to reduce CPU consumption */ + if ((time (NULL) - g_lastCallTime) > 60) { /* detect disconnected mapped network shares and removed * their associated drives from the list -- cgit v1.2.3