You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by ab...@apache.org on 2024/01/16 06:08:49 UTC

(incubator-devlake) branch main updated: feat: add fullsync flag to DirectRun (#6819)

This is an automated email from the ASF dual-hosted git repository.

abeizn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new 0a4e91980 feat: add fullsync flag to DirectRun (#6819)
0a4e91980 is described below

commit 0a4e91980e05de76fcf8cbcd6955273d989dd277
Author: Klesh Wong <zh...@merico.dev>
AuthorDate: Tue Jan 16 14:08:45 2024 +0800

    feat: add fullsync flag to DirectRun (#6819)
---
 backend/core/runner/directrun.go | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/backend/core/runner/directrun.go b/backend/core/runner/directrun.go
index 8d596651d..47c440706 100644
--- a/backend/core/runner/directrun.go
+++ b/backend/core/runner/directrun.go
@@ -37,6 +37,7 @@ import (
 // RunCmd FIXME ...
 func RunCmd(cmd *cobra.Command) {
 	cmd.Flags().StringSliceP("subtasks", "t", nil, "specify what tasks to run, --subtasks=collectIssues,extractIssues")
+	cmd.Flags().BoolP("fullsync", "f", false, "run fullsync")
 	err := cmd.Execute()
 	if err != nil {
 		panic(err)
@@ -54,6 +55,10 @@ func DirectRun(cmd *cobra.Command, args []string, pluginTask plugin.PluginTask,
 	if err != nil {
 		panic(err)
 	}
+	fullSync, err := cmd.Flags().GetBool("fullsync")
+	if err != nil {
+		panic(err)
+	}
 	if pluginInit, ok := pluginTask.(plugin.PluginInit); ok {
 		err = pluginInit.Init(basicRes)
 		if err != nil {
@@ -94,6 +99,7 @@ func DirectRun(cmd *cobra.Command, args []string, pluginTask plugin.PluginTask,
 		}
 		syncPolicy.TimeAfter = &parsedTimeAfter
 	}
+	syncPolicy.FullSync = fullSync
 
 	err = RunPluginSubTasks(
 		ctx,