Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
117369aa
Commit
117369aa
authored
Feb 15, 2024
by
Daniel Hiltgen
Browse files
Exit if we detect another copy of Ollama running
parent
1ba734de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
app/lifecycle/lifecycle.go
app/lifecycle/lifecycle.go
+3
-2
No files found.
app/lifecycle/lifecycle.go
View file @
117369aa
...
@@ -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 runn
ing"
)
slog
.
Info
(
"Detected another instance of ollama running, exit
ing"
)
// 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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment