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 1ff0fbb90 fix: finalizable-entity collector issues in full sync mode
1ff0fbb90 is described below
commit 1ff0fbb90934ec6a3639309a32507d5e7abd13f1
Author: abeizn <[email protected]>
AuthorDate: Thu Oct 19 14:10:00 2023 +0800
fix: finalizable-entity collector issues in full sync mode
---
backend/helpers/pluginhelper/api/api_collector_with_state.go | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/backend/helpers/pluginhelper/api/api_collector_with_state.go
b/backend/helpers/pluginhelper/api/api_collector_with_state.go
index c4b22f110..a8fd00ea8 100644
--- a/backend/helpers/pluginhelper/api/api_collector_with_state.go
+++ b/backend/helpers/pluginhelper/api/api_collector_with_state.go
@@ -183,6 +183,14 @@ 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,