Skip to content

Commit

Permalink
Fix rotondo running development in production.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Leduc-Hamel committed Mar 8, 2021
1 parent e066c1d commit 103b34c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion services/rotondo/pkg/apps/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (s *Scheduler) RunDevelopment(ctx context.Context) error {
ctx, cancelFun := context.WithCancel(ctx)
defer cancelFun()

_, err := s.scheduler.Every(1).Minute().Do(s.rougecombien(ctx))
_, err := s.scheduler.Every(1).Minute().Do(s.rougecombienDevelopment(ctx))

if err != nil {
return err
Expand All @@ -52,6 +52,16 @@ func (s *Scheduler) RunDevelopment(ctx context.Context) error {
}

func (s *Scheduler) rougecombien(ctx context.Context) func() {
return func() {
app := rougecombien.NewRougecombien(s.cfg)
err := app.Run(ctx)
if err != nil {
panic(err)
}
}
}

func (s *Scheduler) rougecombienDevelopment(ctx context.Context) func() {
return func() {
app := rougecombien.NewRougecombien(s.cfg)
err := app.RunDevelopment(ctx)
Expand Down

0 comments on commit 103b34c

Please sign in to comment.