service_test.go 499 B

12345678910111213141516171819202122232425262728293031
  1. package services_test
  2. import (
  3. "testing"
  4. "time"
  5. "fpdxfeed/services"
  6. "fpdxfeed/config"
  7. "fpdxfeed/database"
  8. )
  9. func TestExecTask(t *testing.T) {
  10. conf, _ := config.NewConfig("../.env.yml")
  11. conns, _ := database.NewConns(conf)
  12. debug := 0
  13. goLimit := 10
  14. sleep := int64(1)
  15. sleepDuration := time.Duration(sleep) * time.Minute
  16. n0 := 1
  17. dt1 := 0.1
  18. dt2 := 0.2
  19. dt3 := 0.3
  20. dt4 := 0.4
  21. s, _ := services.NewService(conf, conns, debug, goLimit, sleepDuration, n0, dt1, dt2, dt3, dt4)
  22. s.Run()
  23. }