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
43f9d920
Commit
43f9d920
authored
Aug 05, 2024
by
Michael Yang
Browse files
close pid file
parent
ed6c8bfe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
gpu/assets.go
gpu/assets.go
+3
-7
No files found.
gpu/assets.go
View file @
43f9d920
...
...
@@ -49,13 +49,9 @@ func PayloadsDir() (string, error) {
}
// Track our pid so we can clean up orphaned tmpdirs
pidFilePath
:=
filepath
.
Join
(
tmpDir
,
"ollama.pid"
)
pidFile
,
err
:=
os
.
OpenFile
(
pidFilePath
,
os
.
O_CREATE
|
os
.
O_TRUNC
|
os
.
O_WRONLY
,
os
.
ModePerm
)
if
err
!=
nil
{
return
""
,
err
}
if
_
,
err
:=
pidFile
.
Write
([]
byte
(
strconv
.
Itoa
(
os
.
Getpid
())));
err
!=
nil
{
return
""
,
err
n
:=
filepath
.
Join
(
tmpDir
,
"ollama.pid"
)
if
err
:=
os
.
WriteFile
(
n
,
[]
byte
(
strconv
.
Itoa
(
os
.
Getpid
())),
0
o644
);
err
!=
nil
{
return
""
,
fmt
.
Errorf
(
"failed to write pid file %s: %w"
,
n
,
err
)
}
// We create a distinct subdirectory for payloads within the tmpdir
...
...
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