fix(cloudmon): avoid undetected new resources (#23777)

This commit is contained in:
屈轩
2025-11-20 10:48:47 +08:00
committed by GitHub
parent 7442954db5
commit 0938fac2ec
+1 -3
View File
@@ -139,6 +139,7 @@ func (self *SBaseResources) init(ctx context.Context) error {
}
self.deletedAt = time.Now()
self.updatedAt = time.Now()
self.importedAt = time.Now()
log.Infof("init %d %s importedAt: %s createdAt: %s", len(self.Resources), self.manager.GetKeyword(), self.importedAt, self.createdAt)
return nil
}
@@ -146,9 +147,6 @@ func (self *SBaseResources) init(ctx context.Context) error {
func (self *SBaseResources) increment(ctx context.Context) error {
s := auth.GetAdminSession(ctx, options.Options.Region)
timeFilter := fmt.Sprintf("imported_at.gt('%s')", self.importedAt.Format(time.RFC3339))
if self.importedAt.IsZero() {
timeFilter = fmt.Sprintf("created_at.gt('%s')", self.createdAt.Format(time.RFC3339))
}
query := map[string]interface{}{
"limit": 20,
"scope": "system",