This is an automated email from the ASF dual-hosted git repository.
abeizn pushed a commit to branch fix-finalizable-entity-collector
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to
refs/heads/fix-finalizable-entity-collector by this push:
new 34626c3ef fix: finalizable entity collector
34626c3ef is described below
commit 34626c3ef95d044c4c5fbfd9ef1333b6232a1320
Author: abeizn <[email protected]>
AuthorDate: Thu Oct 19 16:39:10 2023 +0800
fix: finalizable entity collector
---
backend/helpers/pluginhelper/api/api_collector_with_state.go | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/backend/helpers/pluginhelper/api/api_collector_with_state.go
b/backend/helpers/pluginhelper/api/api_collector_with_state.go
index a8fd00ea8..fdbdea013 100644
--- a/backend/helpers/pluginhelper/api/api_collector_with_state.go
+++ b/backend/helpers/pluginhelper/api/api_collector_with_state.go
@@ -184,13 +184,6 @@ func NewStatefulApiCollectorForFinalizableEntity(args
FinalizableApiCollectorArg
createdAfter := manager.Since
isIncremental := manager.IsIncremental
- // if the sync policy is full sync, isIncremental should be false and
createdAfter should be syncPolicy.TimeAfter
- syncPolicy := args.Ctx.TaskContext().SyncPolicy()
- if syncPolicy != nil && syncPolicy.FullSync {
- isIncremental = false
- createdAfter = syncPolicy.TimeAfter
- }
-
// step 1: create a collector to collect newly added records
err = manager.InitCollector(ApiCollectorArgs{
ApiClient: args.ApiClient,
@@ -254,7 +247,8 @@ func NewStatefulApiCollectorForFinalizableEntity(args
FinalizableApiCollectorArg
return nil, err
}
- if args.CollectUnfinishedDetails == nil {
+ syncPolicy := args.Ctx.TaskContext().SyncPolicy()
+ if args.CollectUnfinishedDetails == nil || (syncPolicy != nil &&
syncPolicy.FullSync) {
return manager, nil
}