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
662568d4
Commit
662568d4
authored
Jun 20, 2024
by
Josh Yan
Browse files
err!=nil check
parent
4ebb66c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
gpu/assets.go
gpu/assets.go
+12
-8
No files found.
gpu/assets.go
View file @
662568d4
...
@@ -84,16 +84,20 @@ func cleanupTmpDirs() {
...
@@ -84,16 +84,20 @@ func cleanupTmpDirs() {
}
}
pid
,
err
:=
strconv
.
Atoi
(
string
(
raw
))
pid
,
err
:=
strconv
.
Atoi
(
string
(
raw
))
if
err
==
nil
{
if
err
!=
nil
{
if
proc
,
err
:=
os
.
FindProcess
(
pid
);
err
==
nil
&&
!
errors
.
Is
(
proc
.
Signal
(
syscall
.
Signal
(
0
)),
os
.
ErrProcessDone
)
{
slog
.
Warn
(
"failed to parse pid"
,
"path"
,
d
,
"error"
,
err
)
// Another running ollama, ignore this tmpdir
continue
continue
}
}
}
err
=
os
.
RemoveAll
(
d
)
proc
,
err
:=
os
.
FindProcess
(
pid
)
if
err
!=
nil
{
if
err
==
nil
&&
!
errors
.
Is
(
proc
.
Signal
(
syscall
.
Signal
(
0
)),
os
.
ErrProcessDone
)
{
slog
.
Debug
(
"unable to cleanup stale tmpdir"
,
"path"
,
d
,
"error"
,
err
)
slog
.
Warn
(
"found running ollama"
,
"pid"
,
pid
,
"path"
,
d
)
// Another running ollama, ignore this tmpdir
continue
}
if
err
:=
os
.
Remove
(
d
);
err
!=
nil
{
slog
.
Warn
(
"unable to cleanup stale tmpdir"
,
"path"
,
d
,
"error"
,
err
)
}
}
}
}
}
}
...
...
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