CloudMigrations: Fix issues with snapshot resource limits (#105425) (#105624)

* CloudMigrations: Fix issues with snapshot resource limits (#105425)

* fix bulk inserts

* commit progress so cursor doesn't sabotage me

* add more tests

* get everything working

* rename variable

* update comment

* regen mocks, fix k8s list method maybe

* fix bug with duplicate entries

* lint

* Snapshots: Use slices.Chunk for batching inserts

* remove extra linebreak

---------

Co-authored-by: Matheus Macabu <macabu.matheus@gmail.com>

* manually add unit tests

* make postgres integration tests happy

---------

Co-authored-by: Matheus Macabu <macabu.matheus@gmail.com>
This commit is contained in:
Michael Mandrus
2025-05-19 15:48:26 -04:00
committed by GitHub
co-authored by Matheus Macabu
parent 59cdce6127
commit afacebf16e
9 changed files with 260 additions and 161 deletions
@@ -1121,21 +1121,6 @@ func (d *dashboardStore) DeleteDashboardsInFolders(
})
}
func (d *dashboardStore) GetAllDashboards(ctx context.Context) ([]*dashboards.Dashboard, error) {
ctx, span := tracer.Start(ctx, "dashboards.database.GetAllDashboards")
defer span.End()
var dashboards = make([]*dashboards.Dashboard, 0)
err := d.store.WithDbSession(ctx, func(session *db.Session) error {
err := session.Find(&dashboards)
return err
})
if err != nil {
return nil, err
}
return dashboards, nil
}
func (d *dashboardStore) GetAllDashboardsByOrgId(ctx context.Context, orgID int64) ([]*dashboards.Dashboard, error) {
ctx, span := tracer.Start(ctx, "dashboards.database.GetAllDashboardsByOrgId")
defer span.End()