Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
goSDN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
danet
goSDN
Commits
dfb3503b
Commit
dfb3503b
authored
1 year ago
by
Neil-Jocelyn Schark
Browse files
Options
Downloads
Patches
Plain Diff
test retries
parent
ffe94f9d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
controller/eventService/Service.go
+9
-4
9 additions, 4 deletions
controller/eventService/Service.go
with
9 additions
and
4 deletions
controller/eventService/Service.go
+
9
−
4
View file @
dfb3503b
...
@@ -80,12 +80,17 @@ func NewEventService() (interfaces.Service, error) {
...
@@ -80,12 +80,17 @@ func NewEventService() (interfaces.Service, error) {
}
}
func
connect
(
addr
string
)
(
*
amqp
.
Connection
,
error
)
{
func
connect
(
addr
string
)
(
*
amqp
.
Connection
,
error
)
{
conn
,
err
:=
amqp
.
Dial
(
addr
)
retries
:=
60
if
err
!=
nil
{
return
nil
,
&
customerrs
.
AMQPInitFailError
{
Action
:
"failed to connect to RabbitMQ"
,
Err
:
err
}
for
i
:=
0
;
i
<
retries
;
i
++
{
conn
,
err
:=
amqp
.
Dial
(
addr
)
if
err
==
nil
{
return
conn
,
nil
}
time
.
Sleep
(
2
*
time
.
Second
)
}
}
return
conn
,
nil
return
nil
,
&
customerrs
.
AMQPInitFailError
{
Action
:
"failed to connect to RabbitMQ"
,
Err
:
err
}
}
}
// Reconnect attempts to setup a new connection to the RabbitMQ server after an disconnect.
// Reconnect attempts to setup a new connection to the RabbitMQ server after an disconnect.
...
...
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