This is an automated email from the ASF dual-hosted git repository.
abeizn pushed a commit to branch fix-gitlab-trigger-lint
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/fix-gitlab-trigger-lint by
this push:
new bd13cfe7a fix: update gitlab trigger lint
bd13cfe7a is described below
commit bd13cfe7a4cf849a9fa197b6eb2520db4fc341b7
Author: abeizn <[email protected]>
AuthorDate: Fri Jan 26 09:42:49 2024 +0800
fix: update gitlab trigger lint
---
backend/plugins/gitlab/tasks/trigger_job_collector.go | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/backend/plugins/gitlab/tasks/trigger_job_collector.go
b/backend/plugins/gitlab/tasks/trigger_job_collector.go
index 210f0f046..7053fd7c3 100644
--- a/backend/plugins/gitlab/tasks/trigger_job_collector.go
+++ b/backend/plugins/gitlab/tasks/trigger_job_collector.go
@@ -18,12 +18,13 @@ limitations under the License.
package tasks
import (
+ "reflect"
+ "time"
+
"github.com/apache/incubator-devlake/core/dal"
"github.com/apache/incubator-devlake/core/errors"
"github.com/apache/incubator-devlake/core/plugin"
helper "github.com/apache/incubator-devlake/helpers/pluginhelper/api"
- "reflect"
- "time"
)
func init() {
@@ -43,9 +44,9 @@ var CollectApiTriggerJobsMeta = plugin.SubTaskMeta{
func CollectApiTriggerJobs(taskCtx plugin.SubTaskContext) errors.Error {
rawDataSubTaskArgs, data := CreateRawDataSubTaskArgs(taskCtx,
RAW_TRIGGER_JOB_TABLE)
- collectorWithState, err :=
helper.NewStatefulApiCollector(*rawDataSubTaskArgs, data.TimeAfter)
+ collectorWithState, err :=
helper.NewStatefulApiCollector(*rawDataSubTaskArgs)
tickInterval, err := helper.CalcTickInterval(200, 1*time.Minute)
- incremental := collectorWithState.IsIncremental()
+ incremental := collectorWithState.IsIncremental
iterator, err := GetAllPipelinesIterator(taskCtx, collectorWithState)
@@ -79,8 +80,8 @@ func GetAllPipelinesIterator(taskCtx plugin.SubTaskContext,
collectorWithState *
data.Options.ProjectId, data.Options.ConnectionId,
),
}
- if collectorWithState.LatestState.LatestSuccessStart != nil {
- clauses = append(clauses, dal.Where("gitlab_updated_at > ?",
*collectorWithState.LatestState.LatestSuccessStart))
+ if collectorWithState.IsIncremental && collectorWithState.Since != nil {
+ clauses = append(clauses, dal.Where("gitlab_updated_at > ?",
collectorWithState.Since))
}
// construct the input iterator
cursor, err := db.Cursor(clauses...)