Skip to content

Commit

Permalink
Disable event notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
josephdrichard committed Jun 20, 2024
1 parent 401ddd8 commit 444b8ae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions pkg/daemon/daemon/gpsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (g *GPSD) CmdStop() {
}
}
if g.subscriber != nil {
g.unRegisterSubscriber()
//g.unRegisterSubscriber()
}
<-g.exitCh // waiting for all child routines to exit; we could add timeout to avoid waiting
g.monitorCancel()
Expand All @@ -151,14 +151,14 @@ func (g *GPSD) CmdInit() {
func (g *GPSD) CmdRun(stdoutToSocket bool) {
defer func() {
if g.subscriber != nil {
g.unRegisterSubscriber()
//g.unRegisterSubscriber()
}
}()
// clean up
if g.subscriber != nil {
g.unRegisterSubscriber()
//g.unRegisterSubscriber()
}
g.subscriber = &GPSDSubscriber{source: event.MONITORING, gpsd: g, id: string(event.GNSS)}
//g.subscriber = &GPSDSubscriber{source: event.MONITORING, gpsd: g, id: string(event.GNSS)}
//g.registerSubscriber()
processStatus(g.name, g.messageTag, PtpProcessUp)
for {
Expand Down
18 changes: 9 additions & 9 deletions pkg/daemon/dpll/dpll.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ func (d *DpllConfig) CmdRun(stdToSocket bool) {

func (d *DpllConfig) unRegisterAll() {
// register to event notification from other processes
for _, s := range d.subscriber {
event.StateRegisterer.Unregister(s)
}
//for _, s := range d.subscriber {
// event.StateRegisterer.Unregister(s)
//}
}

// NewDpll ... create new DPLL process
Expand Down Expand Up @@ -588,16 +588,16 @@ func (d *DpllConfig) MonitorProcess(processCfg config.ProcessConfig) {
}

func (d *DpllConfig) unRegisterAllSubscriber() {
for _, s := range d.subscriber {
event.StateRegisterer.Unregister(s)
}
//for _, s := range d.subscriber {
// event.StateRegisterer.Unregister(s)
//}
d.subscriber = []*DpllSubscriber{}
}

func (d *DpllConfig) registerAllSubscriber() {
for _, s := range d.subscriber {
event.StateRegisterer.Register(s)
}
//for _, s := range d.subscriber {
// event.StateRegisterer.Register(s)
//}
}

// MonitorDpll monitors DPLL on the discovered API, if any
Expand Down

0 comments on commit 444b8ae

Please sign in to comment.