diff --git a/dde-daemon.spec b/dde-daemon.spec index eadefa3e622c5c427aa91dd764cc5f0607d04176..fd1c61aa1476ac8004682a85f1a3c67082f694e7 100644 --- a/dde-daemon.spec +++ b/dde-daemon.spec @@ -12,7 +12,7 @@ Name: dde-daemon Version: 5.13.16.11 -Release: 5 +Release: 6 Summary: Daemon handling the DDE session settings License: GPLv3 URL: http://shuttle.corp.deepin.com/cache/tasks/18802/unstable-amd64/ @@ -183,6 +183,9 @@ fi %{_sysusersdir}/%{sname}.conf %changelog +* Fri Jul 21 2023 zhaoshuang - 5.13.16.11-6 +- fix: fix the issue enabling module repeatly + * Thu Mar 16 2023 liweiganga - 5.13.16.11-5 - feat: fix strip diff --git a/fix-the-issue-enabling-module-repeatly.patch b/fix-the-issue-enabling-module-repeatly.patch new file mode 100644 index 0000000000000000000000000000000000000000..e4ef2a999e4e3be23dd42992ba07fdcd56707d7a --- /dev/null +++ b/fix-the-issue-enabling-module-repeatly.patch @@ -0,0 +1,58 @@ +From f1cd188642c95ef40e23582927052ae0e02a9e61 Mon Sep 17 00:00:00 2001 +From: kkz +Date: Fri, 21 Jul 2023 11:46:46 +0800 +Subject: [PATCH] fix: fix the issue enabling module repeatly + +--- + loader/loader.go | 9 +++++++++ + loader/module.go | 7 ++++--- + 2 files changed, 13 insertions(+), 3 deletions(-) + +diff --git a/loader/loader.go b/loader/loader.go +index d218ab6..00126aa 100644 +--- a/loader/loader.go ++++ b/loader/loader.go +@@ -164,6 +164,10 @@ func (l *Loader) EnableModules(enablingModules []string, disableModules []string + + go func() { + l.log.Info("enable module", name) ++ if module.IsEnable() == true { ++ l.log.Infof("module %s has been enabled", name) ++ return; ++ } + startTime := time.Now() + + // wait for its dependency +@@ -185,6 +189,11 @@ func (l *Loader) EnableModules(enablingModules []string, disableModules []string + + for _, n := range nodes { + m := l.modules[n.ID] ++ ++ if m.IsEnable() == true { ++ continue; ++ } ++ + m.WaitEnable() + } + +diff --git a/loader/module.go b/loader/module.go +index 3e623a4..343474b 100644 +--- a/loader/module.go ++++ b/loader/module.go +@@ -51,9 +51,10 @@ type ModuleBase struct { + + func NewModuleBase(name string, impl ModuleImpl, logger *log.Logger) *ModuleBase { + return &ModuleBase{ +- name: name, +- impl: impl, +- log: logger, ++ name: name, ++ impl: impl, ++ log: logger, ++ enable:false, + } + } + +-- +2.27.0 +