diff --git a/graphql/admin/config.go b/graphql/admin/config.go index d570f98cb4d..e72abbe6a5b 100644 --- a/graphql/admin/config.go +++ b/graphql/admin/config.go @@ -28,7 +28,7 @@ import ( ) type configInput struct { - LruMB float64 + LruMB *float64 // LogRequest is used to update WorkerOptions.LogRequest. true value of LogRequest enables // logging of all requests coming to alphas. LogRequest type has been kept as *bool instead of // bool to avoid updating WorkerOptions.LogRequest when it has default value of false. @@ -43,8 +43,9 @@ func resolveUpdateConfig(ctx context.Context, m schema.Mutation) (*resolve.Resol return resolve.EmptyResult(m, err), false } - if input.LruMB > 0 { - if err = worker.UpdateLruMb(input.LruMB); err != nil { + // update LruMB only when it is specified by user + if input.LruMB != nil { + if err = worker.UpdateLruMb(*input.LruMB); err != nil { return resolve.EmptyResult(m, err), false } }