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
caf2b13c
Unverified
Commit
caf2b13c
authored
Feb 13, 2024
by
bnorick
Committed by
GitHub
Feb 13, 2024
Browse files
Fix infinite keep_alive (#2480)
parent
1d263449
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
api/types.go
api/types.go
+2
-4
No files found.
api/types.go
View file @
caf2b13c
...
@@ -415,8 +415,7 @@ func (d *Duration) UnmarshalJSON(b []byte) (err error) {
...
@@ -415,8 +415,7 @@ func (d *Duration) UnmarshalJSON(b []byte) (err error) {
switch
t
:=
v
.
(
type
)
{
switch
t
:=
v
.
(
type
)
{
case
float64
:
case
float64
:
if
t
<
0
{
if
t
<
0
{
t
=
math
.
MaxFloat64
d
.
Duration
=
time
.
Duration
(
math
.
MaxInt64
)
d
.
Duration
=
time
.
Duration
(
t
)
}
else
{
}
else
{
d
.
Duration
=
time
.
Duration
(
t
*
float64
(
time
.
Second
))
d
.
Duration
=
time
.
Duration
(
t
*
float64
(
time
.
Second
))
}
}
...
@@ -426,8 +425,7 @@ func (d *Duration) UnmarshalJSON(b []byte) (err error) {
...
@@ -426,8 +425,7 @@ func (d *Duration) UnmarshalJSON(b []byte) (err error) {
return
err
return
err
}
}
if
d
.
Duration
<
0
{
if
d
.
Duration
<
0
{
mf
:=
math
.
MaxFloat64
d
.
Duration
=
time
.
Duration
(
math
.
MaxInt64
)
d
.
Duration
=
time
.
Duration
(
mf
)
}
}
}
}
...
...
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