MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / stop

Method stop

sqlchain/observer/service.go:340–358  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

338}
339
340func (s *Service) stop() (err error) {
341 if !atomic.CompareAndSwapInt32(&s.stopped, 0, 1) {
342 // stopped
343 return ErrStopped
344 }
345
346 // send cancel subscription to all databases
347 log.Info("stop subscribing all databases")
348
349 s.subscription.Range(func(_, rawWorker interface{}) bool {
350 unpackWorker(rawWorker).stop()
351 return true
352 })
353
354 // close the subscription database
355 _ = s.db.Close()
356
357 return
358}
359
360func (s *Service) minerRequest(dbID proto.DatabaseID, method string, request interface{}, response interface{}) (err error) {
361 instance, err := s.getUpstream(dbID)

Callers 1

stopServiceFunction · 0.45

Calls 3

InfoFunction · 0.92
unpackWorkerFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected