You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by kl...@apache.org on 2024/01/16 05:56:21 UTC
(incubator-devlake) 01/01: feat: add fullsync flag to DirectRun
This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch kw-feat-directrun-supports-fullsync
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit d82efeb341715a96f08de5cbb7c94d7d26250643
Author: Klesh Wong <zh...@merico.dev>
AuthorDate: Tue Jan 16 13:55:32 2024 +0800
feat: add fullsync flag to DirectRun
---
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,