Server endpoints goroutine refactor #69
2 changed files with 10 additions and 10 deletions
2
main.go
2
main.go
|
@ -30,7 +30,7 @@ func main() {
|
||||||
// This will cancel goroutines with the server finishes.
|
// This will cancel goroutines with the server finishes.
|
||||||
// ctxWCancel, cancel := context.WithCancel(ctx)
|
// ctxWCancel, cancel := context.WithCancel(ctx)
|
||||||
// defer cancel()
|
// defer cancel()
|
||||||
stopGroup := stop.NewDebug()
|
stopGroup := stop.New()
|
||||||
// defer stopGroup.Stop()
|
// defer stopGroup.Stop()
|
||||||
|
|
||||||
initsignals(stopGroup.Ch())
|
initsignals(stopGroup.Ch())
|
||||||
|
|
|
@ -58,7 +58,7 @@ var regTestAddrs = [30]string{
|
||||||
|
|
||||||
func TestServerGetHeight(t *testing.T) {
|
func TestServerGetHeight(t *testing.T) {
|
||||||
secondaryPath := "asdf"
|
secondaryPath := "asdf"
|
||||||
grp := stop.New()
|
grp := stop.NewDebug()
|
||||||
db, err := db.GetProdDB(regTestDBPath, secondaryPath, grp)
|
db, err := db.GetProdDB(regTestDBPath, secondaryPath, grp)
|
||||||
defer db.Shutdown()
|
defer db.Shutdown()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -89,7 +89,7 @@ func TestServerGetHeight(t *testing.T) {
|
||||||
|
|
||||||
func TestGetChunk(t *testing.T) {
|
func TestGetChunk(t *testing.T) {
|
||||||
secondaryPath := "asdf"
|
secondaryPath := "asdf"
|
||||||
grp := stop.New()
|
grp := stop.NewDebug()
|
||||||
db, err := db.GetProdDB(regTestDBPath, secondaryPath, grp)
|
db, err := db.GetProdDB(regTestDBPath, secondaryPath, grp)
|
||||||
defer db.Shutdown()
|
defer db.Shutdown()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -133,7 +133,7 @@ func TestGetChunk(t *testing.T) {
|
||||||
|
|
||||||
func TestGetHeader(t *testing.T) {
|
func TestGetHeader(t *testing.T) {
|
||||||
secondaryPath := "asdf"
|
secondaryPath := "asdf"
|
||||||
grp := stop.New()
|
grp := stop.NewDebug()
|
||||||
db, err := db.GetProdDB(regTestDBPath, secondaryPath, grp)
|
db, err := db.GetProdDB(regTestDBPath, secondaryPath, grp)
|
||||||
defer db.Shutdown()
|
defer db.Shutdown()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -163,7 +163,7 @@ func TestGetHeader(t *testing.T) {
|
||||||
|
|
||||||
func TestHeaders(t *testing.T) {
|
func TestHeaders(t *testing.T) {
|
||||||
secondaryPath := "asdf"
|
secondaryPath := "asdf"
|
||||||
grp := stop.New()
|
grp := stop.NewDebug()
|
||||||
db, err := db.GetProdDB(regTestDBPath, secondaryPath, grp)
|
db, err := db.GetProdDB(regTestDBPath, secondaryPath, grp)
|
||||||
defer db.Shutdown()
|
defer db.Shutdown()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -195,7 +195,7 @@ func TestHeaders(t *testing.T) {
|
||||||
|
|
||||||
func TestHeadersSubscribe(t *testing.T) {
|
func TestHeadersSubscribe(t *testing.T) {
|
||||||
args := MakeDefaultTestArgs()
|
args := MakeDefaultTestArgs()
|
||||||
grp := stop.New()
|
grp := stop.NewDebug()
|
||||||
secondaryPath := "asdf"
|
secondaryPath := "asdf"
|
||||||
db, err := db.GetProdDB(regTestDBPath, secondaryPath, grp)
|
db, err := db.GetProdDB(regTestDBPath, secondaryPath, grp)
|
||||||
defer db.Shutdown()
|
defer db.Shutdown()
|
||||||
|
@ -288,7 +288,7 @@ func TestHeadersSubscribe(t *testing.T) {
|
||||||
|
|
||||||
func TestGetBalance(t *testing.T) {
|
func TestGetBalance(t *testing.T) {
|
||||||
secondaryPath := "asdf"
|
secondaryPath := "asdf"
|
||||||
|
|||||||
grp := stop.New()
|
grp := stop.NewDebug()
|
||||||
db, err := db.GetProdDB(regTestDBPath, secondaryPath, grp)
|
db, err := db.GetProdDB(regTestDBPath, secondaryPath, grp)
|
||||||
defer db.Shutdown()
|
defer db.Shutdown()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -318,7 +318,7 @@ func TestGetBalance(t *testing.T) {
|
||||||
|
|
||||||
func TestGetHistory(t *testing.T) {
|
func TestGetHistory(t *testing.T) {
|
||||||
secondaryPath := "asdf"
|
secondaryPath := "asdf"
|
||||||
grp := stop.New()
|
grp := stop.NewDebug()
|
||||||
db, err := db.GetProdDB(regTestDBPath, secondaryPath, grp)
|
db, err := db.GetProdDB(regTestDBPath, secondaryPath, grp)
|
||||||
defer db.Shutdown()
|
defer db.Shutdown()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -348,7 +348,7 @@ func TestGetHistory(t *testing.T) {
|
||||||
|
|
||||||
func TestListUnspent(t *testing.T) {
|
func TestListUnspent(t *testing.T) {
|
||||||
secondaryPath := "asdf"
|
secondaryPath := "asdf"
|
||||||
grp := stop.New()
|
grp := stop.NewDebug()
|
||||||
db, err := db.GetProdDB(regTestDBPath, secondaryPath, grp)
|
db, err := db.GetProdDB(regTestDBPath, secondaryPath, grp)
|
||||||
defer db.Shutdown()
|
defer db.Shutdown()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -378,7 +378,7 @@ func TestListUnspent(t *testing.T) {
|
||||||
|
|
||||||
func TestAddressSubscribe(t *testing.T) {
|
func TestAddressSubscribe(t *testing.T) {
|
||||||
args := MakeDefaultTestArgs()
|
args := MakeDefaultTestArgs()
|
||||||
grp := stop.New()
|
grp := stop.NewDebug()
|
||||||
secondaryPath := "asdf"
|
secondaryPath := "asdf"
|
||||||
db, err := db.GetProdDB(regTestDBPath, secondaryPath, grp)
|
db, err := db.GetProdDB(regTestDBPath, secondaryPath, grp)
|
||||||
defer db.Shutdown()
|
defer db.Shutdown()
|
||||||
|
|
Loading…
Reference in a new issue
defer db.Shutdown()
to match style elsewhere.