Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Hepto
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACIDES
Hepto
Commits
2c279e05
Commit
2c279e05
authored
2 years ago
by
kaiyou
Browse files
Options
Downloads
Patches
Plain Diff
Sleep properly when detecting ip
parent
b56b0ecd
No related branches found
No related tags found
No related merge requests found
Pipeline
#8842
passed
2 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmd/hepto/root.go
+1
-1
1 addition, 1 deletion
cmd/hepto/root.go
with
1 addition
and
1 deletion
cmd/hepto/root.go
+
1
−
1
View file @
2c279e05
...
@@ -85,11 +85,11 @@ func containerize() {
...
@@ -85,11 +85,11 @@ func containerize() {
// Guess the current IP address
// Guess the current IP address
func
waitForIP
()
net
.
IP
{
func
waitForIP
()
net
.
IP
{
for
{
for
{
time
.
Sleep
(
time
.
Second
)
logrus
.
Debug
(
"Determining current IP address"
)
logrus
.
Debug
(
"Determining current IP address"
)
conn
,
err
:=
net
.
Dial
(
"udp"
,
fmt
.
Sprintf
(
"[%s]:53"
,
defaultDNS
[
0
]
.
String
()))
conn
,
err
:=
net
.
Dial
(
"udp"
,
fmt
.
Sprintf
(
"[%s]:53"
,
defaultDNS
[
0
]
.
String
()))
if
err
!=
nil
{
if
err
!=
nil
{
logrus
.
Debug
(
err
)
logrus
.
Debug
(
err
)
time
.
Sleep
(
time
.
Second
)
continue
continue
}
}
localAddr
:=
conn
.
LocalAddr
()
.
(
*
net
.
UDPAddr
)
.
IP
localAddr
:=
conn
.
LocalAddr
()
.
(
*
net
.
UDPAddr
)
.
IP
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment