Fix High CPU (#189)

* vendor in kelindar/event lib and refactor to remove time.Ticker
This commit is contained in:
Benson Wong
2025-07-15 18:04:30 -07:00
committed by GitHub
parent a906cd459b
commit 6299c1b874
11 changed files with 741 additions and 11 deletions

View File

@@ -8,7 +8,7 @@ import (
"os"
"sync"
"github.com/kelindar/event"
"github.com/mostlygeek/llama-swap/event"
)
type LogLevel int
@@ -40,7 +40,7 @@ func NewLogMonitor() *LogMonitor {
func NewLogMonitorWriter(stdout io.Writer) *LogMonitor {
return &LogMonitor{
eventbus: event.NewDispatcher(),
eventbus: event.NewDispatcherConfig(1000),
buffer: ring.New(10 * 1024), // keep 10KB of buffered logs
stdout: stdout,
level: LevelInfo,

View File

@@ -14,7 +14,7 @@ import (
"syscall"
"time"
"github.com/kelindar/event"
"github.com/mostlygeek/llama-swap/event"
)
type ProcessState string

View File

@@ -7,7 +7,7 @@ import (
"sort"
"github.com/gin-gonic/gin"
"github.com/kelindar/event"
"github.com/mostlygeek/llama-swap/event"
)
type Model struct {