mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-10-29 14:37:02 +00:00
23 lines
363 B
Go
23 lines
363 B
Go
//go:build !darwin || !cgo
|
|
|
|
package oomkiller
|
|
|
|
import (
|
|
"github.com/sagernet/sing-box/adapter"
|
|
)
|
|
|
|
func (s *Service) Start(stage adapter.StartStage, scope *adapter.Scope) error {
|
|
if stage != adapter.StartStateStart {
|
|
return nil
|
|
}
|
|
err := s.startTimer()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
scope.Add(func() error {
|
|
s.stopTimer()
|
|
return nil
|
|
})
|
|
return nil
|
|
}
|