diff --git a/dde-daemon.spec b/dde-daemon.spec index 2e25a8d51490f92a63e00288cacbffd91855c9cd..70b966348d198006c85bf9a715e10850e7f3c690 100644 --- a/dde-daemon.spec +++ b/dde-daemon.spec @@ -12,7 +12,7 @@ Name: dde-daemon Version: 5.13.85.8 -Release: 3 +Release: 4 Summary: Daemon handling the DDE session settings License: GPLv3 URL: http://shuttle.corp.deepin.com/cache/tasks/18802/unstable-amd64/ @@ -20,6 +20,7 @@ Source0: %{name}-%{version}.tar.gz Source1: vendor.tar.gz Source2: %{sname}.sysusers #Patch1: 0001-Fix-the-system-monitor-displaying-a-scene.patch +Patch1: fix-the-issue-enabling-module-repeatly.patch BuildRequires: python3 BuildRequires: golang @@ -188,6 +189,9 @@ fi /etc/lightdm/deepin/xsettingsd.conf %changelog +* Fri Jul 21 2023 zhaoshuang - 5.13.85.8-4 +- fix: fix the issue enabling module repeatly + * Wed May 31 2023 hanshuang - 5.13.85.8-3 - fix: install start problem diff --git a/fix-the-issue-enabling-module-repeatly.patch b/fix-the-issue-enabling-module-repeatly.patch new file mode 100644 index 0000000000000000000000000000000000000000..15be283d668940d3eed7f0ba5a577ca48aa63531 --- /dev/null +++ b/fix-the-issue-enabling-module-repeatly.patch @@ -0,0 +1,59 @@ +From cbc116c79d0783fa7e280b15758fd19fe2a06d67 Mon Sep 17 00:00:00 2001 +From: kkz +Date: Fri, 21 Jul 2023 11:18:50 +0800 +Subject: [PATCH] fix: fix the issue enabling module repeatly + +--- + loader/loader.go | 10 ++++++++++ + loader/module.go | 7 ++++--- + 2 files changed, 14 insertions(+), 3 deletions(-) + +diff --git a/loader/loader.go b/loader/loader.go +index d218ab6..b34e9e8 100644 +--- a/loader/loader.go ++++ b/loader/loader.go +@@ -164,6 +164,11 @@ 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 +190,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 325a572..b4320db 100644 +--- a/loader/module.go ++++ b/loader/module.go +@@ -54,9 +54,10 @@ type ModuleBase struct { + + func NewModuleBase(name string, impl ModuleImpl, logger *log.Logger) *ModuleBase { + m := &ModuleBase{ +- name: name, +- impl: impl, +- log: logger, ++ name: name, ++ impl: impl, ++ log: logger, ++ enabled:false, + } + + // 此为等待「enabled」的 WaitGroup,故在 enable 完成之前,需要一直为等待状态。 +-- +2.27.0 +