Skip to content

Commit

Permalink
possible fix (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmolina79 authored Jun 22, 2020
1 parent 26b8d4c commit 72f745b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# vendor/

.idea/
debug/

.env
space.json
Expand Down
8 changes: 8 additions & 0 deletions core/textile/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,18 @@ func (tl *textileThreadListener) Listen(ctx context.Context) error {
}

channel, err := threads.Listen(bucketCtx, *dbID, []threadsc.ListenOption{opt})
if err != nil {
log.Printf("error on threads.listen")
return err
}

tl.setToStarted()

listenerEventHandler := func(val threadsc.ListenEvent) {
log.Debug("received from channel!!!!")
instance := &BucketData{}
if val.Err != nil {
log.Printf("error from threads event " + val.Err.Error())
log.Error("error getting threadsc listener event", err)
return
}
Expand All @@ -87,6 +92,9 @@ func (tl *textileThreadListener) Listen(ctx context.Context) error {
case val, ok := <-channel:
if ok {
listenerEventHandler(val)
} else {
tl.Close()
return
}
}
}
Expand Down

0 comments on commit 72f745b

Please sign in to comment.