-
Notifications
You must be signed in to change notification settings - Fork 620
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid duplicated batch updates (#1029)
Co-authored-by: georgehao <[email protected]>
- Loading branch information
1 parent
2f1abc0
commit 3676368
Showing
20 changed files
with
224 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package fetcher | ||
|
||
import "sync/atomic" | ||
|
||
// SyncInfo is a struct that stores synchronization information shared between L1 fetcher and L2 fetcher. | ||
type SyncInfo struct { | ||
l2ScanHeight uint64 | ||
} | ||
|
||
// SetL2ScanHeight is a method that sets the value of l2ScanHeight in SyncInfo. | ||
func (s *SyncInfo) SetL2ScanHeight(height uint64) { | ||
atomic.StoreUint64(&s.l2ScanHeight, height) | ||
} | ||
|
||
// GetL2ScanHeight is a method that retrieves the value of l2ScanHeight in SyncInfo. | ||
func (s *SyncInfo) GetL2ScanHeight() uint64 { | ||
return atomic.LoadUint64(&s.l2ScanHeight) | ||
} |
Oops, something went wrong.