Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnishapi
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
varnishapi
Commits
55b50754
Commit
55b50754
authored
Aug 20, 2018
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VSM.AttachTmo() uses time.Truncate().
parent
0de7803a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
vsm.go
internal/pkg/vsm/vsm.go
+5
-5
No files found.
internal/pkg/vsm/vsm.go
View file @
55b50754
...
...
@@ -95,16 +95,16 @@ func (v *VSM) Error() string {
}
// AttachTmo sets the timeout for attaching to a Varnish instance. If
// the Duration,
rounded to seconds toward 0s, is >= 0s, then wait
//
that many seconds to attach. If the Duration < 0s, wait
//
indefinitely. By default, the Varnish default timeout holds (5s in
//
recent Varnish
versions).
// the Duration,
truncated to seconds, is >= 0s, then wait that many
//
seconds to attach. If the Duration < 0s, wait indefinitely. By
//
default, the Varnish default timeout holds (5s in recent Varnish
// versions).
func
(
v
*
VSM
)
AttachTmo
(
tmo
time
.
Duration
)
error
{
if
err
:=
v
.
checkNil
();
err
!=
nil
{
return
err
}
arg
:=
"off"
secs
:=
tmo
/
time
.
Second
secs
:=
tmo
.
Truncate
(
time
.
Second
)
if
secs
>=
0
{
arg
=
strconv
.
FormatUint
(
uint64
(
secs
),
10
)
}
...
...
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