Chore: Propagate context for quotas (#39205)

Propagate context for quotas and queries/commands.

Ref #36734
This commit is contained in:
Marcus Efraimsson
2021-09-20 17:05:30 +02:00
committed by GitHub
parent fef8e646ea
commit 1e4a660ea7
7 changed files with 222 additions and 211 deletions

View File

@@ -2018,7 +2018,7 @@ func TestQuota(t *testing.T) {
t.Run("when quota limit exceed creating new rule should fail", func(t *testing.T) {
// get existing org quota
query := models.GetOrgQuotaByTargetQuery{OrgId: 1, Target: "alert_rule"}
err = sqlstore.GetOrgQuotaByTarget(&query)
err = store.GetOrgQuotaByTarget(context.Background(), &query)
require.NoError(t, err)
used := query.Result.Used
limit := query.Result.Limit
@@ -2029,7 +2029,7 @@ func TestQuota(t *testing.T) {
Target: "alert_rule",
Limit: used,
}
err := sqlstore.UpdateOrgQuota(&orgCmd)
err := store.UpdateOrgQuota(context.Background(), &orgCmd)
require.NoError(t, err)
t.Cleanup(func() {
@@ -2039,7 +2039,7 @@ func TestQuota(t *testing.T) {
Target: "alert_rule",
Limit: limit,
}
err := sqlstore.UpdateOrgQuota(&orgCmd)
err := store.UpdateOrgQuota(context.Background(), &orgCmd)
require.NoError(t, err)
})