cmd/geth: fix js unclean shutdown (#22302)
This commit is contained in:
		@@ -19,10 +19,8 @@ package main
 | 
				
			|||||||
import (
 | 
					import (
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
	"os/signal"
 | 
					 | 
				
			||||||
	"path/filepath"
 | 
						"path/filepath"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
	"syscall"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/ethereum/go-ethereum/cmd/utils"
 | 
						"github.com/ethereum/go-ethereum/cmd/utils"
 | 
				
			||||||
	"github.com/ethereum/go-ethereum/console"
 | 
						"github.com/ethereum/go-ethereum/console"
 | 
				
			||||||
@@ -218,13 +216,10 @@ func ephemeralConsole(ctx *cli.Context) error {
 | 
				
			|||||||
			utils.Fatalf("Failed to execute %s: %v", file, err)
 | 
								utils.Fatalf("Failed to execute %s: %v", file, err)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	// Wait for pending callbacks, but stop for Ctrl-C.
 | 
					 | 
				
			||||||
	abort := make(chan os.Signal, 1)
 | 
					 | 
				
			||||||
	signal.Notify(abort, syscall.SIGINT, syscall.SIGTERM)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	go func() {
 | 
						go func() {
 | 
				
			||||||
		<-abort
 | 
							stack.Wait()
 | 
				
			||||||
		os.Exit(0)
 | 
							console.Stop(false)
 | 
				
			||||||
	}()
 | 
						}()
 | 
				
			||||||
	console.Stop(true)
 | 
						console.Stop(true)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user