-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'sprint-july-4' into refactor/db-txn
- Loading branch information
Showing
7 changed files
with
66 additions
and
44 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
29 changes: 29 additions & 0 deletions
29
code/go/0chain.net/blobbercore/writemarker/protocol_integration_tests.go
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,29 @@ | ||
//go:build integration_tests | ||
// +build integration_tests | ||
|
||
package writemarker | ||
|
||
import ( | ||
"context" | ||
"time" | ||
|
||
"github.com/0chain/blobber/code/go/0chain.net/conductor/conductrpc" | ||
"github.com/0chain/blobber/code/go/0chain.net/core/node" | ||
) | ||
|
||
func (wme *WriteMarkerEntity) RedeemMarker(ctx context.Context) error { | ||
for { | ||
state := conductrpc.Client().State() | ||
if state.StopWMCommit != nil && *state.StopWMCommit { | ||
time.Sleep(time.Second * 5) | ||
continue | ||
} | ||
break | ||
} | ||
err := wme.redeemMarker(ctx) | ||
if err == nil { | ||
// send state to conductor server | ||
conductrpc.Client().BlobberCommitted(node.Self.ID) | ||
} | ||
return err | ||
} |
10 changes: 10 additions & 0 deletions
10
code/go/0chain.net/blobbercore/writemarker/protocol_main.go
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,10 @@ | ||
//go:build !integration_tests | ||
// +build !integration_tests | ||
|
||
package writemarker | ||
|
||
import "context" | ||
|
||
func (wme *WriteMarkerEntity) RedeemMarker(ctx context.Context) error { | ||
return wme.redeemMarker(ctx) | ||
} |
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