From 3775a5e70e393b54df51c9569bc57c443fd81a8f Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 16 Aug 2021 20:07:23 -0400 Subject: [PATCH] less logging --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 3faa994..89621de 100644 --- a/main.go +++ b/main.go @@ -75,7 +75,6 @@ func (c *MetadataCache) Delete(o int64) { } func (c *MetadataCache) Get(o int64, k string) ([]string, error) { - log.Printf("Get %d, %s.\n", o, k) // Check cache for entry c.lock.RLock() object, ok := c.objects[o] @@ -126,7 +125,6 @@ func loadDbEntries(ot string, id int64) map[string]metadataValues { return entries } query := fmt.Sprintf("select meta_key, meta_value from %s where %s = ?", table, column) - log.Println(query) rows, err := db.Query(query, id) if err != nil { log.Printf("db.Query: %s\n", err.Error()) @@ -199,12 +197,14 @@ func handleConnection(conn net.Conn, UC MetadataCache, PC MetadataCache) { var m *MetadataCache reader := bufio.NewReader(conn) tp := textproto.NewReader(reader) + num:=0 for { buf, err := tp.ReadLine() if err != nil { conn.Close() return } + num++ var c cachecommand err = json.Unmarshal([]byte(buf), &c) if err != nil { @@ -233,5 +233,5 @@ func handleConnection(conn net.Conn, UC MetadataCache, PC MetadataCache) { } conn.Write([]byte("\n")) } - + log.Printf("Ended connection after %d queries", num) }