Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(GraphQL): don't update cacheMb if not specified by user (GRAPHQL-888) #7103

Merged
merged 2 commits into from
Dec 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions graphql/admin/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
)

type configInput struct {
CacheMb float64
CacheMb *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.
Expand All @@ -42,8 +42,11 @@ func resolveUpdateConfig(ctx context.Context, m schema.Mutation) (*resolve.Resol
return resolve.EmptyResult(m, err), false
}

if err = worker.UpdateCacheMb(int64(input.CacheMb)); err != nil {
return resolve.EmptyResult(m, err), false
// update cacheMB only when it is specified by user
if input.CacheMb != nil {
if err = worker.UpdateCacheMb(int64(*input.CacheMb)); err != nil {
return resolve.EmptyResult(m, err), false
}
}

// input.LogRequest will be nil, when it is not specified explicitly in config request.
Expand Down