Skip to content
This repository has been archived by the owner on Dec 3, 2021. It is now read-only.

Commit

Permalink
Re-enable scheduler
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Oswalt <[email protected]>
  • Loading branch information
Mierdin committed Feb 3, 2019
1 parent 22c27fa commit e3bb82e
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions cmd/syringed/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
config "github.com/nre-learning/syringe/config"
"github.com/nre-learning/syringe/scheduler"
log "github.com/sirupsen/logrus"
"k8s.io/client-go/rest"
)

func init() {
Expand All @@ -28,10 +29,10 @@ func main() {
log.Fatalf("Invalid configuration. Please re-run Syringe with appropriate env variables")
}

// kubeConfig, err := rest.InClusterConfig()
// if err != nil {
// log.Fatal(err)
// }
kubeConfig, err := rest.InClusterConfig()
if err != nil {
log.Fatal(err)
}

lessonDefs, err := api.ImportLessonDefs(syringeConfig, syringeConfig.LessonsDir)
if err != nil {
Expand All @@ -40,20 +41,20 @@ func main() {

// Start lesson scheduler
lessonScheduler := scheduler.LessonScheduler{
// KubeConfig: kubeConfig,
KubeConfig: kubeConfig,
Requests: make(chan *scheduler.LessonScheduleRequest),
Results: make(chan *scheduler.LessonScheduleResult),
LessonDefs: lessonDefs,
SyringeConfig: syringeConfig,
GcWhiteList: make(map[string]*pb.Session),
GcWhiteListMu: &sync.Mutex{},
}
// go func() {
// err = lessonScheduler.Start()
// if err != nil {
// log.Fatalf("Problem starting lesson scheduler: %s", err)
// }
// }()
go func() {
err = lessonScheduler.Start()
if err != nil {
log.Fatalf("Problem starting lesson scheduler: %s", err)
}
}()

antidoteSha, err := ioutil.ReadFile(fmt.Sprintf("%s/.git/refs/heads/%s", syringeConfig.LessonRepoDir, syringeConfig.LessonRepoBranch))
if err != nil {
Expand Down

0 comments on commit e3bb82e

Please sign in to comment.