sync: add more debug logs

This commit is contained in:
c9s 2022-06-24 17:14:30 +08:00
parent 4f42f90b49
commit cace7c8f97
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -115,16 +115,19 @@ func (sel SyncTask) execute(ctx context.Context, db *sqlx.DB, startTime time.Tim
obj := v.Interface() obj := v.Interface()
id := sel.ID(obj) id := sel.ID(obj)
if _, exists := ids[id]; exists { if _, exists := ids[id]; exists {
logrus.Debugf("object %s already exists, skipping", id)
continue continue
} }
tt := sel.Time(obj) tt := sel.Time(obj)
if tt.Before(startTime) || tt.After(endTime) { if tt.Before(startTime) || tt.After(endTime) {
logrus.Debugf("object %s time %s is outside of the time range", id, tt)
continue continue
} }
if sel.Filter != nil { if sel.Filter != nil {
if !sel.Filter(obj) { if !sel.Filter(obj) {
logrus.Debugf("object %s is filtered", id)
continue continue
} }
} }