Adjust comments

This commit is contained in:
Ingo Oppermann
2024-08-21 17:02:22 +02:00
parent 3756ce4977
commit 1c56d53a6b
2 changed files with 2 additions and 1 deletions

View File

@@ -425,6 +425,7 @@ func (l *limiter) Limit(cpu, memory bool) error {
// limitCPU will limit the CPU usage of this process. The limit is the max. CPU usage // limitCPU will limit the CPU usage of this process. The limit is the max. CPU usage
// normed to 0-1. The interval defines how long a time slot is that will be splitted // normed to 0-1. The interval defines how long a time slot is that will be splitted
// into sleeping and working. // into sleeping and working.
// Inspired by https://github.com/opsengine/cpulimit
func (l *limiter) limitCPU(ctx context.Context, limit float64, interval time.Duration) { func (l *limiter) limitCPU(ctx context.Context, limit float64, interval time.Duration) {
defer func() { defer func() {
l.lock.Lock() l.lock.Lock()

View File

@@ -43,7 +43,7 @@ type Process interface {
// running or not. // running or not.
IsRunning() bool IsRunning() bool
// Limit enabled or disables CPU and memory limiting. CPU will be throttled // Limit enables or disables CPU and memory limiting. CPU will be throttled
// into the configured limit. If memory consumption is above the configured // into the configured limit. If memory consumption is above the configured
// limit, the process will be killed. // limit, the process will be killed.
Limit(cpu, memory bool) error Limit(cpu, memory bool) error