Skip to content

Commit

Permalink
currently if there is an error subscribing to an existing peer channe…
Browse files Browse the repository at this point in the history
…l we will fail with a fatal error and stop the server. We don't want that as then the server wonb't start up, now we log an error and move on (#179)
  • Loading branch information
theflyingcodr authored Aug 2, 2022
1 parent 0cc0c94 commit 0ae0e3c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cmd/internal/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func SetupHealthEndpoint(cfg config.Config, g *echo.Group, c *client.Client, dep
}

// ResumeActiveChannels resume listening to active peer channels.
func ResumeActiveChannels(deps *SocketDeps) error {
func ResumeActiveChannels(deps *SocketDeps, l log.Logger) error {
ctx := context.Background()
channels, err := deps.PeerChannelsService.ActiveProofChannels(ctx)
if err != nil {
Expand All @@ -141,7 +141,7 @@ func ResumeActiveChannels(deps *SocketDeps) error {
for _, channel := range channels {
ch := channel
if err := deps.PeerChannelsNotifyService.Subscribe(ctx, &ch); err != nil {
return err
l.Errorf(err, "failed to re-subscribe to channel %s", ch.ID)
}
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func main() {

go func() {
for {
if err := internal.ResumeActiveChannels(deps); err != nil {
if err := internal.ResumeActiveChannels(deps, log); err != nil {
log.Fatal(err, "failed to resume active peer channels")
}
// retry channels we are waiting on in case the proof hasn't been received
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.faucet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: "3.7"
services:
payd:
container_name: payd
image: local.payd
image: libsv/payd:0.1.11
environment:
DB_DSN: "file:paydb/wallet.db?_foreign_keys=true&pooling=true"
LOG_LEVEL: "debug"
Expand All @@ -21,7 +21,7 @@ services:

payd-merchant:
container_name: payd-merchant
image: local.payd
image: libsv/payd:0.1.11
volumes:
- ./run/regtest/payd-merchant:/paydb

4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: "3.7"
services:
payd:
container_name: payd
image: local.payd
image: libsv/payd:0.1.11
environment:
DB_DSN: "file:paydb/wallet.db?_foreign_keys=true&pooling=true"
LOG_LEVEL: "info"
Expand All @@ -24,7 +24,7 @@ services:

payd-merchant:
container_name: payd-merchant
image: local.payd
image: libsv/payd:0.1.11
environment:
DB_DSN: "file:paydb/merchant-wallet.db?_foreign_keys=true&pooling=true"
SERVER_HOST: payd-merchant:28443
Expand Down

0 comments on commit 0ae0e3c

Please sign in to comment.