Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
d2b626a3
Commit
d2b626a3
authored
Jun 25, 2021
by
Mark Tyneway
Committed by
Liam Horne
Jun 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
syncservice: nit
parent
7e04137d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
sync_service.go
l2geth/rollup/sync_service.go
+6
-6
No files found.
l2geth/rollup/sync_service.go
View file @
d2b626a3
...
@@ -129,28 +129,28 @@ func NewSyncService(ctx context.Context, cfg Config, txpool *core.TxPool, bc *co
...
@@ -129,28 +129,28 @@ func NewSyncService(ctx context.Context, cfg Config, txpool *core.TxPool, bc *co
if
service
.
enable
{
if
service
.
enable
{
// Ensure that the rollup client can connect to a remote server
// Ensure that the rollup client can connect to a remote server
// before starting. Retry until it can connect.
// before starting. Retry until it can connect.
t
1
:=
time
.
NewTicker
(
10
*
time
.
Second
)
t
Ensure
:=
time
.
NewTicker
(
10
*
time
.
Second
)
for
;
true
;
<-
t
1
.
C
{
for
;
true
;
<-
t
Ensure
.
C
{
err
:=
service
.
ensureClient
()
err
:=
service
.
ensureClient
()
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Info
(
"Cannot connect to upstream service"
,
"msg"
,
err
)
log
.
Info
(
"Cannot connect to upstream service"
,
"msg"
,
err
)
}
else
{
}
else
{
log
.
Info
(
"Connected to upstream service"
)
log
.
Info
(
"Connected to upstream service"
)
t
1
.
Stop
()
t
Ensure
.
Stop
()
break
break
}
}
}
}
// Wait until the remote service is done syncing
// Wait until the remote service is done syncing
t
2
:=
time
.
NewTicker
(
10
*
time
.
Second
)
t
Status
:=
time
.
NewTicker
(
10
*
time
.
Second
)
for
;
true
;
<-
t
2
.
C
{
for
;
true
;
<-
t
Status
.
C
{
status
,
err
:=
service
.
client
.
SyncStatus
(
service
.
backend
)
status
,
err
:=
service
.
client
.
SyncStatus
(
service
.
backend
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Error
(
"Cannot get sync status"
)
log
.
Error
(
"Cannot get sync status"
)
continue
continue
}
}
if
!
status
.
Syncing
{
if
!
status
.
Syncing
{
t
2
.
Stop
()
t
Status
.
Stop
()
break
break
}
}
log
.
Info
(
"Still syncing"
,
"index"
,
status
.
CurrentTransactionIndex
,
"tip"
,
status
.
HighestKnownTransactionIndex
)
log
.
Info
(
"Still syncing"
,
"index"
,
status
.
CurrentTransactionIndex
,
"tip"
,
status
.
HighestKnownTransactionIndex
)
...
...
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