Add some basic prints

This commit is contained in:
Your Name 2021-08-16 18:00:04 -04:00
parent d27123dd24
commit 61977e06f9
3 changed files with 5 additions and 0 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
.idea
wp-metacache

View File

@ -72,6 +72,7 @@ func (c *MetadataCache) Delete(o int64) {
}
func (c *MetadataCache) Get(o int64, k string) ([]string, error) {
log.Printf("Get %d, %s", o, k)
// Check cache for entry
c.lock.RLock()
defer c.lock.Unlock()
@ -107,6 +108,7 @@ func (c *MetadataCache) Get(o int64, k string) ([]string, error) {
}
func loadDbEntries(ot string, id int64) map[string]metadataValues {
log.Println("loadDbEntries")
var entries map[string]metadataValues
entries=make (map[string]metadataValues)
var table string
@ -188,11 +190,13 @@ type cachecommand struct {
}
func handleConnection(conn net.Conn, UC MetadataCache, PC MetadataCache) {
log.Println("handleConnection started")
var buf []byte
var m *MetadataCache
_, err := conn.Read(buf)
var c cachecommand
err = json.Unmarshal(buf, &c)
log.Printf("JSON got: %#v", c)
var values []string
if c.ObjectType == "u" {
m = &UC

Binary file not shown.