Skip to content

Commit 0ae0e3c

Browse files
currently if there is an error subscribing to an existing peer channel 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)
1 parent 0cc0c94 commit 0ae0e3c

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

cmd/internal/internal.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func SetupHealthEndpoint(cfg config.Config, g *echo.Group, c *client.Client, dep
131131
}
132132

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

cmd/server/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func main() {
102102

103103
go func() {
104104
for {
105-
if err := internal.ResumeActiveChannels(deps); err != nil {
105+
if err := internal.ResumeActiveChannels(deps, log); err != nil {
106106
log.Fatal(err, "failed to resume active peer channels")
107107
}
108108
// retry channels we are waiting on in case the proof hasn't been received

docker-compose.faucet.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: "3.7"
33
services:
44
payd:
55
container_name: payd
6-
image: local.payd
6+
image: libsv/payd:0.1.11
77
environment:
88
DB_DSN: "file:paydb/wallet.db?_foreign_keys=true&pooling=true"
99
LOG_LEVEL: "debug"
@@ -21,7 +21,7 @@ services:
2121

2222
payd-merchant:
2323
container_name: payd-merchant
24-
image: local.payd
24+
image: libsv/payd:0.1.11
2525
volumes:
2626
- ./run/regtest/payd-merchant:/paydb
2727

docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: "3.7"
33
services:
44
payd:
55
container_name: payd
6-
image: local.payd
6+
image: libsv/payd:0.1.11
77
environment:
88
DB_DSN: "file:paydb/wallet.db?_foreign_keys=true&pooling=true"
99
LOG_LEVEL: "info"
@@ -24,7 +24,7 @@ services:
2424

2525
payd-merchant:
2626
container_name: payd-merchant
27-
image: local.payd
27+
image: libsv/payd:0.1.11
2828
environment:
2929
DB_DSN: "file:paydb/merchant-wallet.db?_foreign_keys=true&pooling=true"
3030
SERVER_HOST: payd-merchant:28443

0 commit comments

Comments
 (0)