Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make the file writing to be idempotent #15

Merged
merged 1 commit into from
Aug 19, 2024
Merged

Conversation

alexgao001
Copy link
Collaborator

@alexgao001 alexgao001 commented Aug 19, 2024

Description

make the file writing to be idempotent. Blob dir will be deleted after finalising a bundle a the finalising height , but retry would happen on the same block in the case writing state to DB failed.

Rationale

tell us why we need these changes...

Example

add an example CLI or API response...

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

syncer/syncer.go Outdated
@@ -111,6 +111,7 @@ func (s *BlobSyncer) StartLoop() {
for range syncTicker.C {
if err = s.sync(); err != nil {
logging.Logger.Errorf("failed to sync, err=%s", err.Error())
time.Sleep(2 * time.Second)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

time.Sleep(2 * time.Second)
can you make it as a variable like xxxPauseTime

syncer/syncer.go Outdated
@@ -119,6 +120,7 @@ func (s *BlobSyncer) StartLoop() {
for range verifyTicket.C {
if err := s.verify(); err != nil {
logging.Logger.Errorf("failed to verify, err=%s", err.Error())
time.Sleep(2 * time.Second)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@alexgao001 alexgao001 merged commit 5e0dcd6 into master Aug 19, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants