Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/lastore-daemon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ func main() {
logger.Error("failed to new server manager and updater object:", err)
return
}
manager.initAgent()
manager.initPlatformManager()
if config.IntranetUpdate {
//不再依赖检查更新或者online定时器触发,而是直接创建
Expand Down
10 changes: 10 additions & 0 deletions src/lastore-daemon/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ func NewManager(service *dbusutil.Service, updateApi system.System, c *config.Co
go func() {
m.setPropHardwareId(updateplatform.GetHardwareId(m.config.IncludeDiskInfo, m.config.GetHardwareIdByHelper))
}()
m.initAgent() // 先初始化 userAgents
m.initDbusSignalListen()
m.initDSettingsChangedHandle()
m.syncThirdPartyDconfig()
Expand Down Expand Up @@ -934,6 +935,11 @@ func (m *Manager) handleSessionNew(sessionId string, sessionPath dbus.ObjectPath

uidStr := strconv.Itoa(int(userInfo.UID))

if m.userAgents == nil {
logger.Warning("userAgents not initialized, skipping addSession")
return
}

newlyAdded := m.userAgents.addSession(uidStr, session)
if newlyAdded {
m.watchSession(uidStr, session)
Expand All @@ -942,6 +948,10 @@ func (m *Manager) handleSessionNew(sessionId string, sessionPath dbus.ObjectPath

func (m *Manager) handleSessionRemoved(sessionId string, sessionPath dbus.ObjectPath) {
logger.Debug("session removed", sessionId, sessionPath)
if m.userAgents == nil {
logger.Warning("userAgents not initialized, skipping removeSession")
return
}
m.userAgents.removeSession(sessionPath)
}

Expand Down
Loading