mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2025-12-31 01:10:20 -06:00
build(deps): bump github.com/KimMachineGun/automemlimit
Bumps [github.com/KimMachineGun/automemlimit](https://github.com/KimMachineGun/automemlimit) from 0.7.2 to 0.7.3. - [Release notes](https://github.com/KimMachineGun/automemlimit/releases) - [Commits](https://github.com/KimMachineGun/automemlimit/compare/v0.7.2...v0.7.3) --- updated-dependencies: - dependency-name: github.com/KimMachineGun/automemlimit dependency-version: 0.7.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
2
go.mod
2
go.mod
@@ -5,7 +5,7 @@ go 1.24.1
|
||||
require (
|
||||
dario.cat/mergo v1.0.2
|
||||
github.com/CiscoM31/godata v1.0.11
|
||||
github.com/KimMachineGun/automemlimit v0.7.2
|
||||
github.com/KimMachineGun/automemlimit v0.7.3
|
||||
github.com/Masterminds/semver v1.5.0
|
||||
github.com/MicahParks/keyfunc/v2 v2.1.0
|
||||
github.com/Nerzal/gocloak/v13 v13.9.0
|
||||
|
||||
4
go.sum
4
go.sum
@@ -68,8 +68,8 @@ github.com/CiscoM31/godata v1.0.11 h1:w7y8twuW02LdH6mak3/GJ5i0GrCv2IoZUJVqa/g5Ye
|
||||
github.com/CiscoM31/godata v1.0.11/go.mod h1:ZMiT6JuD3Rm83HEtiTx4JEChsd25YCrxchKGag/sdTc=
|
||||
github.com/DeepDiver1975/secure v0.0.0-20240611112133-abc838fb797c h1:ocsNvQ2tNHme4v/lTs17HROamc7mFzZfzWcg4m+UXN0=
|
||||
github.com/DeepDiver1975/secure v0.0.0-20240611112133-abc838fb797c/go.mod h1:BmF5hyM6tXczk3MpQkFf1hpKSRqCyhqcbiQtiAF7+40=
|
||||
github.com/KimMachineGun/automemlimit v0.7.2 h1:DyfHI7zLWmZPn2Wqdy2AgTiUvrGPmnYWgwhHXtAegX4=
|
||||
github.com/KimMachineGun/automemlimit v0.7.2/go.mod h1:QZxpHaGOQoYvFhv/r4u3U0JTC2ZcOwbSr11UZF46UBM=
|
||||
github.com/KimMachineGun/automemlimit v0.7.3 h1:oPgMp0bsWez+4fvgSa11Rd9nUDrd8RLtDjBoT3ro+/A=
|
||||
github.com/KimMachineGun/automemlimit v0.7.3/go.mod h1:QZxpHaGOQoYvFhv/r4u3U0JTC2ZcOwbSr11UZF46UBM=
|
||||
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
|
||||
github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
|
||||
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
|
||||
|
||||
30
vendor/github.com/KimMachineGun/automemlimit/memlimit/memlimit.go
generated
vendored
30
vendor/github.com/KimMachineGun/automemlimit/memlimit/memlimit.go
generated
vendored
@@ -169,7 +169,7 @@ func SetGoMemLimitWithOpts(opts ...Option) (_ int64, _err error) {
|
||||
|
||||
// set the memory limit and start refresh
|
||||
limit, err := updateGoMemLimit(uint64(snapshot), provider, cfg.logger)
|
||||
go refresh(provider, cfg.logger, cfg.refresh)
|
||||
refresh(provider, cfg.logger, cfg.refresh)
|
||||
if err != nil {
|
||||
if errors.Is(err, ErrNoLimit) {
|
||||
cfg.logger.Info("memory is not limited, skipping")
|
||||
@@ -200,7 +200,7 @@ func updateGoMemLimit(currLimit uint64, provider Provider, logger *slog.Logger)
|
||||
return newLimit, nil
|
||||
}
|
||||
|
||||
// refresh periodically fetches the memory limit from the provider and reapplies it if it has changed.
|
||||
// refresh spawns a goroutine that runs every refresh duration and updates the GOMEMLIMIT if it has changed.
|
||||
// See more details in the documentation of WithRefreshInterval.
|
||||
func refresh(provider Provider, logger *slog.Logger, refresh time.Duration) {
|
||||
if refresh == 0 {
|
||||
@@ -210,22 +210,24 @@ func refresh(provider Provider, logger *slog.Logger, refresh time.Duration) {
|
||||
provider = noErrNoLimitProvider(provider)
|
||||
|
||||
t := time.NewTicker(refresh)
|
||||
for range t.C {
|
||||
err := func() (_err error) {
|
||||
snapshot := debug.SetMemoryLimit(-1)
|
||||
defer rollbackOnPanic(logger, snapshot, &_err)
|
||||
go func() {
|
||||
for range t.C {
|
||||
err := func() (_err error) {
|
||||
snapshot := debug.SetMemoryLimit(-1)
|
||||
defer rollbackOnPanic(logger, snapshot, &_err)
|
||||
|
||||
_, err := updateGoMemLimit(uint64(snapshot), provider, logger)
|
||||
_, err := updateGoMemLimit(uint64(snapshot), provider, logger)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}()
|
||||
if err != nil {
|
||||
return err
|
||||
logger.Error("failed to refresh GOMEMLIMIT", slog.Any("error", err))
|
||||
}
|
||||
|
||||
return nil
|
||||
}()
|
||||
if err != nil {
|
||||
logger.Error("failed to refresh GOMEMLIMIT", slog.Any("error", err))
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
// rollbackOnPanic rollbacks to the snapshot on panic.
|
||||
|
||||
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@@ -18,7 +18,7 @@ github.com/BurntSushi/toml/internal
|
||||
# github.com/CiscoM31/godata v1.0.11
|
||||
## explicit; go 1.19
|
||||
github.com/CiscoM31/godata
|
||||
# github.com/KimMachineGun/automemlimit v0.7.2
|
||||
# github.com/KimMachineGun/automemlimit v0.7.3
|
||||
## explicit; go 1.22.0
|
||||
github.com/KimMachineGun/automemlimit/memlimit
|
||||
# github.com/Masterminds/goutils v1.1.1
|
||||
|
||||
Reference in New Issue
Block a user