Skip to content

Commit

Permalink
Merge pull request #10433 from 2403905/issue-10427
Browse files Browse the repository at this point in the history
set the memlimit default loglevel to error
  • Loading branch information
2403905 authored Oct 29, 2024
2 parents 753ffa6 + b4f3302 commit f86b5e3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/fix-memlimit-loglevel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Fix the memlimit loglevel

We set the memlimit default loglevel to error.

https://github.com/owncloud/ocis/pull/10431
https://github.com/owncloud/ocis/issues/10428
13 changes: 11 additions & 2 deletions ocis-pkg/shared/memlimit.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
package shared

import (
// we import automemlimit here to include it for ocis als well as individual service binaries
_ "github.com/KimMachineGun/automemlimit"
"log/slog"

"github.com/KimMachineGun/automemlimit/memlimit"
)

// we init the memlimit here to include it for ocis als well as individual service binaries
func init() {
slog.SetLogLoggerLevel(slog.LevelError)
_, _ = memlimit.SetGoMemLimitWithOpts(
memlimit.WithLogger(slog.Default()),
)
}

0 comments on commit f86b5e3

Please sign in to comment.