Skip to content

Commit

Permalink
Don't drop tables
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sevilla <[email protected]>
  • Loading branch information
rsevilla87 committed Dec 1, 2022
1 parent 68b309f commit 26ccfd5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
5 changes: 1 addition & 4 deletions cmd/perfApp/perfApp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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") != "" {
Expand Down Expand Up @@ -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)
}
13 changes: 0 additions & 13 deletions internal/perf/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 26ccfd5

Please sign in to comment.