From d6ee7b071e88af51731e786b840e47840d100a77 Mon Sep 17 00:00:00 2001 From: Simon J Mudd Date: Mon, 12 Jan 2015 17:55:47 +0100 Subject: [PATCH] log success/failure to change ps.setup_instruments --- p_s/setup_instruments/setup_instruments.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/p_s/setup_instruments/setup_instruments.go b/p_s/setup_instruments/setup_instruments.go index c92b6df..595e75a 100644 --- a/p_s/setup_instruments/setup_instruments.go +++ b/p_s/setup_instruments/setup_instruments.go @@ -33,8 +33,6 @@ func (si *SetupInstruments) EnableMutexMonitoring(dbh *sql.DB) { rows, err := dbh.Query(sql) if err != nil { log.Fatal(err) - - } defer rows.Close() @@ -69,11 +67,14 @@ func (si *SetupInstruments) EnableMutexMonitoring(dbh *sql.DB) { log.Fatal(err) } break - } count++ } - lib.Logger.Println(count, "rows changed in p_s.setup_instruments") + if si.update_succeeded { + lib.Logger.Println(count, "rows changed in p_s.setup_instruments") + } else { + lib.Logger.Println( "Insufficient privileges to UPDATE setup_instruments: " . err.String() ) + } } // restore any changed rows back to their original state -- 2.7.4