From 531add52c27f2754c36626f1efeab15029a47e29 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 21 Mar 2019 09:49:04 -0700 Subject: [PATCH] weed master: skip proxied file read in http read only mode --- weed/server/master_server.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/weed/server/master_server.go b/weed/server/master_server.go index a77c8fa19..4ecb9f192 100644 --- a/weed/server/master_server.go +++ b/weed/server/master_server.go @@ -93,7 +93,9 @@ func NewMasterServer(r *mux.Router, port int, metaFolder string, r.HandleFunc("/stats/health", ms.guard.WhiteList(statsHealthHandler)) r.HandleFunc("/stats/counter", ms.guard.WhiteList(statsCounterHandler)) r.HandleFunc("/stats/memory", ms.guard.WhiteList(statsMemoryHandler)) - r.HandleFunc("/{fileId}", ms.proxyToLeader(ms.redirectHandler)) + if !httpReadOnly { + r.HandleFunc("/{fileId}", ms.proxyToLeader(ms.redirectHandler)) + } ms.Topo.StartRefreshWritableVolumes(ms.grpcDialOpiton, garbageThreshold, ms.preallocate)