Skip to content
This repository has been archived by the owner on Mar 11, 2022. It is now read-only.

Commit

Permalink
[fix go#27] remove the entity context for a cancelled stream.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcellanz committed Jun 13, 2020
1 parent 7bd8eb4 commit 177f7b3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cloudstate/cloudstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
)

const (
SupportLibraryVersion = "0.1.0"
SupportLibraryVersion = "0.1.1"
SupportLibraryName = "cloudstate-go-support"
)

Expand Down
6 changes: 6 additions & 0 deletions cloudstate/eventsourced.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ func (esh *EventSourcedServer) registerEntity(ese *EventSourcedEntity) error {
func (esh *EventSourcedServer) Handle(stream protocol.EventSourced_HandleServer) error {
var entityId string
var failed error

// "fix" for https://github.com/cloudstateio/go-support/issues/27
// v0.2.x will contain the proper handling for the case of a closed stream.
defer func() {
delete(esh.contexts, entityId)
}()
for {
if failed != nil {
return failed
Expand Down
2 changes: 1 addition & 1 deletion tck/cmd/tck_shoppingcart/shoppingcart.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
func main() {
server, err := cloudstate.New(cloudstate.Config{
ServiceName: "shopping-cart",
ServiceVersion: "0.1.0",
ServiceVersion: "0.1.1",
})
if err != nil {
log.Fatalf("CloudState.New failed: %v", err)
Expand Down

0 comments on commit 177f7b3

Please sign in to comment.