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) }