Skip to content

Commit

Permalink
revert some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
colinlyguo committed Sep 23, 2024
1 parent e0fc1e5 commit eaa6eeb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
10 changes: 2 additions & 8 deletions rollup/rollup_sync_service/rollup_sync_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ func NewRollupSyncService(ctx context.Context, genesisConfig *params.ChainConfig
latestProcessedBlock = *block
}

serviceCtx, cancel := context.WithCancel(ctx)
ctx, cancel := context.WithCancel(ctx)

service := RollupSyncService{
ctx: serviceCtx,
ctx: ctx,
cancel: cancel,
client: client,
db: db,
Expand All @@ -126,9 +126,6 @@ func (s *RollupSyncService) Start() {
return
}

s.stateMu.Lock()
defer s.stateMu.Unlock()

log.Info("Starting rollup event sync background service", "latest processed block", s.latestProcessedBlock)

go func() {
Expand Down Expand Up @@ -156,9 +153,6 @@ func (s *RollupSyncService) Stop() {
return
}

s.stateMu.Lock()
defer s.stateMu.Unlock()

log.Info("Stopping rollup event sync background service")

if s.cancel != nil {
Expand Down
10 changes: 2 additions & 8 deletions rollup/sync_service/sync_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ func NewSyncService(ctx context.Context, genesisConfig *params.ChainConfig, node
latestProcessedBlock = *block
}

serviceCtx, cancel := context.WithCancel(ctx)
ctx, cancel := context.WithCancel(ctx)

service := SyncService{
ctx: serviceCtx,
ctx: ctx,
cancel: cancel,
client: client,
db: db,
Expand All @@ -98,9 +98,6 @@ func (s *SyncService) Start() {
return
}

s.stateMu.Lock()
defer s.stateMu.Unlock()

// wait for initial sync before starting node
log.Info("Starting L1 message sync service", "latestProcessedBlock", s.latestProcessedBlock)

Expand Down Expand Up @@ -135,9 +132,6 @@ func (s *SyncService) Stop() {
return
}

s.stateMu.Lock()
defer s.stateMu.Unlock()

log.Info("Stopping sync service")

// Unsubscribe all subscriptions registered
Expand Down

0 comments on commit eaa6eeb

Please sign in to comment.