mirror of
https://github.com/ollama/ollama.git
synced 2025-03-18 05:41:43 +01:00
Exit if we detect another copy of Ollama running
This commit is contained in:
parent
1ba734de67
commit
117369aa73
@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"log/slog"
|
||||
"os"
|
||||
|
||||
"github.com/jmorganca/ollama/app/store"
|
||||
"github.com/jmorganca/ollama/app/tray"
|
||||
@ -58,8 +59,8 @@ func Run() {
|
||||
}
|
||||
|
||||
if IsServerRunning(ctx) {
|
||||
slog.Debug("XXX detected server already running")
|
||||
// TODO - should we fail fast, try to kill it, or just ignore?
|
||||
slog.Info("Detected another instance of ollama running, exiting")
|
||||
os.Exit(1)
|
||||
} else {
|
||||
done, err = SpawnServer(ctx, CLIName)
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user