mirror of
https://github.com/owncloud/ocis
synced 2026-04-25 17:25:21 +02:00
fix: make docs-generate
fix: error GOMEMLIMIT in doc-generate fix: docs-generate protobuf fix: GOMEMLIMIT error log
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"os/exec"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"text/template"
|
||||
)
|
||||
@@ -71,6 +72,12 @@ func runIntermediateCode(intermediateCodePath string) {
|
||||
defaultDataPath := "/var/lib/ocis"
|
||||
os.Setenv("OCIS_BASE_DATA_PATH", defaultDataPath)
|
||||
os.Setenv("OCIS_CONFIG_DIR", defaultConfigPath)
|
||||
|
||||
// Set AUTOMEMLIMIT_EXPERIMENT=system on non-Linux systems to avoid cgroups errors
|
||||
if runtime.GOOS != "linux" {
|
||||
os.Setenv("AUTOMEMLIMIT_EXPERIMENT", "system")
|
||||
}
|
||||
|
||||
out, err := exec.Command("go", "run", intermediateCodePath).CombinedOutput()
|
||||
if err != nil {
|
||||
log.Fatal(string(out), err)
|
||||
|
||||
@@ -144,6 +144,14 @@ variables:
|
||||
description: The default directory location for config files. See the General Info
|
||||
section in the documentation for more details on defaults.
|
||||
do_ignore: false
|
||||
- rawname: OCIS_INSECURE
|
||||
path: ocis-pkg/service/grpc/client.go:77
|
||||
foundincode: true
|
||||
name: OCIS_INSECURE
|
||||
type: ""
|
||||
default_value: "false"
|
||||
description: "Insecure TLS mode is only allowed in development environments with OCIS_INSECURE=true"
|
||||
do_ignore: false
|
||||
- rawname: RUN_CMD_TEST
|
||||
path: internal/testenv/test.go:32
|
||||
foundincode: true
|
||||
|
||||
@@ -2,6 +2,8 @@ package shared
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"os"
|
||||
"runtime"
|
||||
|
||||
"github.com/KimMachineGun/automemlimit/memlimit"
|
||||
)
|
||||
@@ -9,6 +11,12 @@ import (
|
||||
// we init the memlimit here to include it for ocis als well as individual service binaries
|
||||
func init() {
|
||||
slog.SetLogLoggerLevel(slog.LevelError)
|
||||
|
||||
// Enable system memory provider on non-Linux systems to avoid cgroups errors
|
||||
if runtime.GOOS != "linux" {
|
||||
os.Setenv("AUTOMEMLIMIT_EXPERIMENT", "system")
|
||||
}
|
||||
|
||||
_, _ = memlimit.SetGoMemLimitWithOpts(
|
||||
memlimit.WithLogger(slog.Default()),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user