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
39d9d22c
"src/vscode:/vscode.git/clone" did not exist on "2243a594833ac7274c28aea0b2606a38e5be3eca"
Unverified
Commit
39d9d22c
authored
May 06, 2024
by
Jeffrey Morgan
Committed by
GitHub
May 06, 2024
Browse files
close server on receiving signal (#4213)
parent
af47413d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
cmd/cmd.go
cmd/cmd.go
+6
-1
server/routes.go
server/routes.go
+1
-0
No files found.
cmd/cmd.go
View file @
39d9d22c
...
@@ -898,7 +898,12 @@ func RunServer(cmd *cobra.Command, _ []string) error {
...
@@ -898,7 +898,12 @@ func RunServer(cmd *cobra.Command, _ []string) error {
return
err
return
err
}
}
return
server
.
Serve
(
ln
)
err
=
server
.
Serve
(
ln
)
if
errors
.
Is
(
err
,
http
.
ErrServerClosed
)
{
return
nil
}
return
err
}
}
func
initializeKeypair
()
error
{
func
initializeKeypair
()
error
{
...
...
server/routes.go
View file @
39d9d22c
...
@@ -1041,6 +1041,7 @@ func Serve(ln net.Listener) error {
...
@@ -1041,6 +1041,7 @@ func Serve(ln net.Listener) error {
signal
.
Notify
(
signals
,
syscall
.
SIGINT
,
syscall
.
SIGTERM
)
signal
.
Notify
(
signals
,
syscall
.
SIGINT
,
syscall
.
SIGTERM
)
go
func
()
{
go
func
()
{
<-
signals
<-
signals
srvr
.
Close
()
done
()
done
()
sched
.
unloadAllRunners
()
sched
.
unloadAllRunners
()
gpu
.
Cleanup
()
gpu
.
Cleanup
()
...
...
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