Commit 117369aa authored by Daniel Hiltgen's avatar Daniel Hiltgen
Browse files

Exit if we detect another copy of Ollama running

parent 1ba734de
...@@ -5,6 +5,7 @@ import ( ...@@ -5,6 +5,7 @@ import (
"fmt" "fmt"
"log" "log"
"log/slog" "log/slog"
"os"
"github.com/jmorganca/ollama/app/store" "github.com/jmorganca/ollama/app/store"
"github.com/jmorganca/ollama/app/tray" "github.com/jmorganca/ollama/app/tray"
...@@ -58,8 +59,8 @@ func Run() { ...@@ -58,8 +59,8 @@ func Run() {
} }
if IsServerRunning(ctx) { if IsServerRunning(ctx) {
slog.Debug("XXX detected server already running") slog.Info("Detected another instance of ollama running, exiting")
// TODO - should we fail fast, try to kill it, or just ignore? os.Exit(1)
} else { } else {
done, err = SpawnServer(ctx, CLIName) done, err = SpawnServer(ctx, CLIName)
if err != nil { if err != nil {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment