Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Unified Diff: appengine/gaemiddleware/context.go

Issue 2588213002: Use global rand.Rand instance in mathrand. (Closed)
Patch Set: Better comment. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | common/data/rand/mathrand/impl.go » ('j') | common/data/rand/mathrand/mathrand_test.go » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/gaemiddleware/context.go
diff --git a/appengine/gaemiddleware/context.go b/appengine/gaemiddleware/context.go
index 3f1a63691d9bb5743b057c8344c9068197b9e179..d4215448f58a997c4e2efd5add2ab7e2c58e5c42 100644
--- a/appengine/gaemiddleware/context.go
+++ b/appengine/gaemiddleware/context.go
@@ -17,7 +17,6 @@ import (
"github.com/luci/luci-go/common/config"
"github.com/luci/luci-go/common/data/caching/cacheContext"
"github.com/luci/luci-go/common/data/caching/proccache"
- "github.com/luci/luci-go/common/data/rand/mathrand"
"github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/server/auth"
@@ -62,16 +61,10 @@ var (
// globalTsMonState holds state related to time series monitoring.
globalTsMonState = &tsmon.State{}
-
- // globalMathRand is a global "mathrand.Rand" instance. Get, as per its
- // function signature, returns an instance that is protected by a lock, so
- // this is safe for its expected concurrent use.
- globalMathRand = mathrand.Get(context.Background())
)
// WithProd installs the set of standard production AppEngine services:
// * github.com/luci/luci-go/common/logging (set default level to debug).
-// * github.com/luci/luci-go/common/data/rand/mathrand.
// * github.com/luci/gae/impl/prod (production appengine services)
// * github.com/luci/luci-go/appengine/gaeauth/client (appengine urlfetch transport)
// * github.com/luci/luci-go/server/proccache (in process memory cache)
@@ -82,7 +75,6 @@ var (
func WithProd(c context.Context, req *http.Request) context.Context {
// These are needed to use fetchCachedSettings.
c = logging.SetLevel(c, logging.Debug)
- c = mathrand.SetRand(c, globalMathRand)
c = prod.Use(c, req)
c = settings.Use(c, globalSettings)
« no previous file with comments | « no previous file | common/data/rand/mathrand/impl.go » ('j') | common/data/rand/mathrand/mathrand_test.go » ('J')

Powered by Google App Engine
This is Rietveld 408576698