Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion statefun/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"errors"
"os"
"os/signal"
"strings"
"sync"
"sync/atomic"
"syscall"
Expand Down Expand Up @@ -72,7 +73,7 @@
r.shutdownPhase.Store(ShutdownPhaseNone)

natsOpts := nats.GetDefaultOptions()
natsOpts.Url = r.config.natsURL
natsOpts.Servers = strings.Split(r.config.natsURL, ",")
natsOpts.MaxReconnect = -1 // -1 - infinity attempts
natsOpts.ReconnectedCB = func(nc *nats.Conn) {
lg.GetLogger().Warnf(context.TODO(), "NATS reconnected %d times", nc.Statistics.Reconnects)
Expand Down Expand Up @@ -152,7 +153,7 @@
logger := lg.GetLogger()
phaseOneContext, cancelPhaseOneContext := context.WithCancel(context.Background())
phaseTwoContext, cancelPhaseTwoContext := context.WithCancel(context.Background())
phaseThreeContext, cancelPhaseThreeContext := context.WithCancel(context.Background())

Check failure on line 156 in statefun/runtime.go

View workflow job for this annotation

GitHub Actions / lint

lostcancel: the cancelPhaseThreeContext function is not used on all paths (possible context leak) (govet)

gracefulShutdownFunc := func() {
sig := make(chan os.Signal, 1)
Expand Down Expand Up @@ -208,7 +209,7 @@

// Create streams if they do not exist.
if err := r.createStreams(ctx); err != nil {
return err

Check failure on line 212 in statefun/runtime.go

View workflow job for this annotation

GitHub Actions / lint

lostcancel: this return statement may be reached without using the cancelPhaseThreeContext var defined on line 156 (govet)
}

// Start the domain.
Expand Down Expand Up @@ -291,7 +292,7 @@
wg.Wait()
}

func (r *Runtime) stopRequestSubscriptions() {

Check failure on line 295 in statefun/runtime.go

View workflow job for this annotation

GitHub Actions / lint

func `(*Runtime).stopRequestSubscriptions` is unused (unused)
for {
allFunctionsReadyForShutdown := true
for _, ft := range r.registeredFunctionTypes {
Expand Down
Loading