tasks.go 254 B

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