Skip to content

Commit

Permalink
Add --catchup flag to run command
Browse files Browse the repository at this point in the history
  • Loading branch information
cluttrdev committed Feb 19, 2024
1 parent 3f89585 commit a195a88
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type RunConfig struct {
RootConfig

projects projectList
catchup bool

flags *flag.FlagSet
}
Expand Down Expand Up @@ -76,6 +77,7 @@ func (c *RunConfig) RegisterFlags(fs *flag.FlagSet) {
c.RootConfig.RegisterFlags(fs)

fs.Var(&c.projects, "projects", "Comma separated list of project ids.")
fs.BoolVar(&c.catchup, "catchup", false, "Whether to export historical data. (default: false)")

_ = fs.String("log-level", "info", "The logging level, one of 'debug', 'info', 'warn', 'error'. (default: 'info')")
_ = fs.String("log-format", "text", "The logging format, either 'text' or 'json'. (default: 'text')")
Expand Down Expand Up @@ -143,7 +145,7 @@ func (c *RunConfig) Exec(ctx context.Context, _ []string) error {
pool := worker.NewWorkerPool(42)
var wg sync.WaitGroup
for _, p := range cfg.Projects {
if p.CatchUp.Enabled {
if c.catchup && p.CatchUp.Enabled {
job := jobs.ProjectCatchUpJob{
Config: p,
GitLab: gitlabclient,
Expand Down

0 comments on commit a195a88

Please sign in to comment.