aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-07 10:39:12 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-07 10:59:06 +0200
commitb32e5a528258bba91f237bc28779f39f22390495 (patch)
tree6140e9a52be03fd7949554a569098d0c832b55cb
parentui: defer update popup until 3 seconds after app start (diff)
downloadwireguard-windows-b32e5a528258bba91f237bc28779f39f22390495.tar.xz
wireguard-windows-b32e5a528258bba91f237bc28779f39f22390495.zip
service: delay restart for one second
This prevents a thundering herd. Also, we can now use the restart manager in the MSI because our walk fork handles the right window messages.
-rw-r--r--installer/wireguard.wxs1
-rw-r--r--service/service_manager.go5
2 files changed, 5 insertions, 1 deletions
diff --git a/installer/wireguard.wxs b/installer/wireguard.wxs
index e92177c6..4ae81e5a 100644
--- a/installer/wireguard.wxs
+++ b/installer/wireguard.wxs
@@ -33,7 +33,6 @@
<Property Id="ARPURLINFOABOUT" Value="https://www.wireguard.com/"/>
<Property Id="ARPNOMODIFY" Value="yes" />
<Property Id="DISABLEADVTSHORTCUTS" Value="yes"/>
- <Property Id="MSIRESTARTMANAGERCONTROL" Value="Disable" />
<!--
Upgrading
diff --git a/service/service_manager.go b/service/service_manager.go
index e2ccf4c9..aae11daf 100644
--- a/service/service_manager.go
+++ b/service/service_manager.go
@@ -16,6 +16,7 @@ import (
"runtime/debug"
"sync"
"syscall"
+ "time"
"unsafe"
)
@@ -190,6 +191,10 @@ func (service *managerService) Execute(args []string, r <-chan svc.ChangeRequest
ourReader.Close()
ourWriter.Close()
ourEvents.Close()
+
+ if !stoppingManager {
+ time.Sleep(time.Second)
+ }
}
}