feat: align with new starter.Service interface, reporting queue and drop status (by AI)
This commit is contained in:
parent
1f816dc8b3
commit
3d0fc5e93f
10
writer.go
10
writer.go
@ -110,11 +110,13 @@ func (s *writerService) Stop(_ context.Context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Health implements starter.Service interface.
|
// Status implements starter.Service interface.
|
||||||
func (s *writerService) Health() error {
|
func (s *writerService) Status() (string, error) {
|
||||||
return nil
|
if s.Running.Load() {
|
||||||
|
return fmt.Sprintf("queue: %d, dropped: %d", len(s.LogChannel), s.Dropped.Load()), nil
|
||||||
|
}
|
||||||
|
return "stopped", nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *writerService) writerRunner() {
|
func (s *writerService) writerRunner() {
|
||||||
ticker := time.NewTicker(200 * time.Millisecond)
|
ticker := time.NewTicker(200 * time.Millisecond)
|
||||||
defer ticker.Stop()
|
defer ticker.Stop()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user