task.go 274 B

12345678910111213141516
  1. package task
  2. import (
  3. "github.com/robfig/cron"
  4. "server/edge/camera"
  5. )
  6. func TimeTasks() {
  7. c := cron.New()
  8. //每3分钟监测状态
  9. _ = c.AddFunc("0 */3 * * * ?", func() {
  10. //检查摄像头是否在线
  11. camera.TestCameraOnline(camera.CameraDevices)
  12. })
  13. c.Start()
  14. }