Skip to content

Commit

Permalink
Fix comments on PR #1744
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan-Wilson committed Aug 10, 2023
1 parent bace811 commit 33f6343
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions arbnode/resourcemanager/resource_management.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ func Init(conf *Config) {
if conf.MemoryLimitPercent > 0 {
node.WrapHTTPHandler = func(srv http.Handler) (http.Handler, error) {
var c limitChecker
var err error
c, err = newCgroupsMemoryLimitCheckerIfSupported(conf)
c, err := newCgroupsMemoryLimitCheckerIfSupported(conf)
if errors.Is(err, errNotSupported) {
log.Error("No method for determining memory usage and limits was discovered, disabled memory limit RPC throttling")
c = &trivialLimitChecker{}
Expand Down
3 changes: 1 addition & 2 deletions arbnode/resourcemanager/resource_management_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ func makeCgroupsTestDir(cgroupDir string) cgroupsMemoryFiles {
func TestCgroupsFailIfCantOpen(t *testing.T) {
testFiles := makeCgroupsTestDir(t.TempDir())
c := newCgroupsMemoryLimitChecker(testFiles, 95)
var err error
if _, err = c.isLimitExceeded(); err == nil {
if _, err := c.isLimitExceeded(); err == nil {
t.Fatal("Should fail open if can't read files")
}
}
Expand Down

0 comments on commit 33f6343

Please sign in to comment.