diff --git a/cmd/perfApp/perfApp.go b/cmd/perfApp/perfApp.go index e8c65b9..2a523d4 100644 --- a/cmd/perfApp/perfApp.go +++ b/cmd/perfApp/perfApp.go @@ -24,7 +24,7 @@ func main() { customFormatter.TimestampFormat = "2006-01-02 15:04:05" customFormatter.FullTimestamp = true log.SetFormatter(customFormatter) - c := make(chan os.Signal) + c := make(chan os.Signal, 1) signal.Notify(c, syscall.SIGINT) go handleInterrupt(c) if os.Getenv("POSTGRESQL_HOSTNAME") != "" { @@ -56,8 +56,5 @@ func main() { func handleInterrupt(c <-chan os.Signal) { <-c log.Println("Interrupt signal received") - if err := perf.DropTables(tables); err != nil { - utils.ErrorHandler(err) - } os.Exit(0) } diff --git a/internal/perf/db.go b/internal/perf/db.go index db0a8dc..aa5b2c8 100644 --- a/internal/perf/db.go +++ b/internal/perf/db.go @@ -79,16 +79,3 @@ func CreateTables(tableList []map[string]string) error { } return nil } - -// DropTables Drops all tables at tableList -func DropTables(tableList []map[string]string) error { - for k := range tableList { - for t := range tableList[k] { - log.Infof("Dropping %s table", t) - if err := QueryDB(fmt.Sprintf("DROP TABLE %s", t)); err != nil { - return err - } - } - } - return nil -}