Fix restarting flag for direct restarts
This commit is contained in:
@@ -68,8 +68,6 @@ func shutdown(_ *api.Request) (msg string, err error) {
|
||||
func restart(_ *api.Request) (msg string, err error) {
|
||||
log.Info("core: user requested restart via action")
|
||||
|
||||
// Trigger restart event instead of shutdown event.
|
||||
restarting.Set()
|
||||
// Let the updates module handle restarting.
|
||||
updates.RestartNow()
|
||||
|
||||
|
||||
@@ -7,13 +7,12 @@ import (
|
||||
|
||||
"github.com/safing/portbase/modules"
|
||||
"github.com/safing/portbase/modules/subsystems"
|
||||
"github.com/tevino/abool"
|
||||
"github.com/safing/portmaster/updates"
|
||||
|
||||
// module dependencies
|
||||
_ "github.com/safing/portmaster/netenv"
|
||||
_ "github.com/safing/portmaster/status"
|
||||
_ "github.com/safing/portmaster/ui"
|
||||
_ "github.com/safing/portmaster/updates"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -24,7 +23,6 @@ const (
|
||||
var (
|
||||
module *modules.Module
|
||||
|
||||
restarting = abool.New()
|
||||
disableShutdownEvent bool
|
||||
)
|
||||
|
||||
@@ -82,7 +80,7 @@ func registerEvents() {
|
||||
|
||||
func shutdownHook() {
|
||||
// Notify everyone of the restart/shutdown.
|
||||
if restarting.IsNotSet() {
|
||||
if !updates.IsRestarting() {
|
||||
// Only trigger shutdown event if not disabled.
|
||||
if !disableShutdownEvent {
|
||||
module.TriggerEvent(eventShutdown, nil)
|
||||
|
||||
Reference in New Issue
Block a user