Skip to content

Commit

Permalink
Fix execution when no projects are configured
Browse files Browse the repository at this point in the history
  • Loading branch information
cluttrdev committed Feb 25, 2024
1 parent 2c04805 commit 687536e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cmd/catchup.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (c *CatchUpConfig) Exec(ctx context.Context, args []string) error {
})
}

{ // jobs
if len(cfg.Projects) > 0 { // jobs
ctx, cancel := context.WithCancel(context.Background())

g.Add(func() error { // execute
Expand Down Expand Up @@ -153,6 +153,8 @@ func (c *CatchUpConfig) Exec(ctx context.Context, args []string) error {
<-ctx.Done()
slog.Info("Cancelling jobs... done")
})
} else {
slog.Warn("There are no projects configured for export")
}

if cfg.HTTP.Enabled {
Expand Down
4 changes: 3 additions & 1 deletion cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func (c *RunConfig) Exec(ctx context.Context, _ []string) error {
})
}

{ // jobs
if len(cfg.Projects) > 0 { // jobs
ctx, cancel := context.WithCancel(context.Background())

g.Add(func() error { // execute
Expand Down Expand Up @@ -209,6 +209,8 @@ func (c *RunConfig) Exec(ctx context.Context, _ []string) error {
<-ctx.Done()
slog.Info("Cancelling jobs... done")
})
} else {
slog.Warn("There are no projects configured for export")
}

if cfg.HTTP.Enabled {
Expand Down

0 comments on commit 687536e

Please sign in to comment.