diff options
| author | Taras Madan <tarasmadan@google.com> | 2025-02-05 10:42:13 +0100 |
|---|---|---|
| committer | Taras Madan <tarasmadan@google.com> | 2025-02-05 12:01:12 +0000 |
| commit | fee2000d0be1fd5964142a14de0371e7547d5589 (patch) | |
| tree | 9ecf2d4b5e454f751484e720aa6219d3d41a271c /dashboard | |
| parent | 8df70c790e03a6b58a02c450122c61bc43478b5d (diff) | |
dashboard/app: use request context
It looks cheaper than appengine.NewContext().
Diffstat (limited to 'dashboard')
| -rw-r--r-- | dashboard/app/batch_coverage.go | 5 | ||||
| -rw-r--r-- | dashboard/app/batch_db_export.go | 3 |
2 files changed, 3 insertions, 5 deletions
diff --git a/dashboard/app/batch_coverage.go b/dashboard/app/batch_coverage.go index aba85cf59..e5b6d0851 100644 --- a/dashboard/app/batch_coverage.go +++ b/dashboard/app/batch_coverage.go @@ -14,14 +14,13 @@ import ( "cloud.google.com/go/civil" "github.com/google/syzkaller/pkg/coveragedb" "google.golang.org/api/iterator" - "google.golang.org/appengine/v2" "google.golang.org/appengine/v2/log" ) const batchCoverageTimeoutSeconds = 60 * 60 * 12 func handleBatchCoverage(w http.ResponseWriter, r *http.Request) { - ctx := appengine.NewContext(r) + ctx := r.Context() doQuarters := r.FormValue("quarters") == "true" doMonths := r.FormValue("months") == "true" doDays := r.FormValue("days") == "true" @@ -153,7 +152,7 @@ func nsDataAvailable(ctx context.Context, ns string) ([]coveragedb.TimePeriod, [ } func handleBatchCoverageClean(w http.ResponseWriter, r *http.Request) { - ctx := context.Background() + ctx := r.Context() totalDeleted, err := coveragedb.DeleteGarbage(ctx, coverageDBClient) if err != nil { errMsg := fmt.Sprintf("failed to coveragedb.DeleteGarbage: %s", err.Error()) diff --git a/dashboard/app/batch_db_export.go b/dashboard/app/batch_db_export.go index 9ca294d70..d667e2728 100644 --- a/dashboard/app/batch_db_export.go +++ b/dashboard/app/batch_db_export.go @@ -7,14 +7,13 @@ import ( "net/http" "cloud.google.com/go/batch/apiv1/batchpb" - "google.golang.org/appengine/v2" "google.golang.org/appengine/v2/log" ) const exportTimeoutSeconds = 60 * 60 * 6 func handleBatchDBExport(w http.ResponseWriter, r *http.Request) { - ctx := appengine.NewContext(r) + ctx := r.Context() for ns, nsConfig := range getConfig(ctx).Namespaces { if nsConfig.ReproExportPath == "" { continue |
