Skip to content

Commit

Permalink
close the rcmgr on shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Jan 20, 2022
1 parent 325a4c0 commit 73ec10a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions node/modules/lp2p/rcmgr.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package lp2p

import (
"context"
"errors"
"fmt"
"os"
Expand Down Expand Up @@ -56,6 +57,11 @@ func ResourceManager(lc fx.Lifecycle, repo repo.LockedRepo) (network.ResourceMan
return nil, fmt.Errorf("error creating resource manager: %w", err)
}

lc.Append(fx.Hook{
OnStop: func(_ context.Context) error {
return mgr.Close()
}})

return mgr, nil
}

Expand Down

0 comments on commit 73ec10a

Please sign in to comment.