Skip to content

Commit d7efc21

Browse files
committed
fix: check updatable packages before send notify
Bug: https://pms.uniontech.com/bug-view-356741.html
1 parent 4be05fb commit d7efc21

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/lastore-daemon/manager_update.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ func (m *Manager) refreshUpdateInfos(sync bool) {
757757
}
758758
m.inhibitAutoQuitCountSub()
759759
}()
760-
if !m.updatePlatform.UpdateNowForce && !m.updatePlatform.UpdateTime.IsZero() {
760+
if !m.updatePlatform.UpdateNowForce && !m.updatePlatform.UpdateTime.IsZero() && len(m.updater.UpdatablePackages) > 0 {
761761
timeStr := m.updatePlatform.UpdateTime.Format(TimeOnly)
762762
if timeStr != m.updateTime {
763763
m.updateTime = timeStr
@@ -784,6 +784,16 @@ func (m *Manager) refreshUpdateInfos(sync bool) {
784784
}
785785
}
786786

787+
func (m *Manager) shouldNotifyScheduledUpdate() bool {
788+
if m == nil || m.updater == nil || m.updatePlatform == nil {
789+
return false
790+
}
791+
if m.updatePlatform.UpdateNowForce || m.updatePlatform.UpdateTime.IsZero() {
792+
return false
793+
}
794+
return len(m.updater.UpdatablePackages) > 0
795+
}
796+
787797
func (m *Manager) updateUpdatableProp(infosMap map[string][]string) {
788798
m.PropsMu.RLock()
789799
updateType := m.UpdateMode

0 commit comments

Comments
 (0)