diff options
author | Ben Morrison <ben@gbmor.dev> | 2019-05-27 03:30:29 -0400 |
---|---|---|
committer | Ben Morrison <ben@gbmor.dev> | 2019-05-27 03:30:29 -0400 |
commit | c38385cfed939f6cfeb9bae32e4104e938454946 (patch) | |
tree | e11db98965c7a6a9370da82dd2baa8ba7310d83f | |
parent | dfa03b5f32e1e7e3ffeb8992d9d393c9c03b6ce0 (diff) | |
download | getwtxt-c38385cfed939f6cfeb9bae32e4104e938454946.tar.gz |
updated field refs wrt getwtxt/registry update
-rw-r--r-- | cache.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cache.go b/cache.go index a5531b0..14fb0b2 100644 --- a/cache.go +++ b/cache.go @@ -45,7 +45,7 @@ func refreshCache() { // Iterate over the registry and // update each individual user. - for k := range twtxtCache.Reg { + for k := range twtxtCache.Users { err := twtxtCache.UpdateUser(k) if err != nil { log.Printf("%v\n", err) @@ -84,7 +84,7 @@ func pushDatabase() error { // per entry. twtxtCache.Mu.RLock() var dbBasket = &leveldb.Batch{} - for k, v := range twtxtCache.Reg { + for k, v := range twtxtCache.Users { dbBasket.Put([]byte(k+"*Nick"), []byte(v.Nick)) dbBasket.Put([]byte(k+"*URL"), []byte(v.URL)) dbBasket.Put([]byte(k+"*IP"), []byte(v.IP.String())) @@ -145,8 +145,8 @@ func pullDatabase() { // it and use it instead. data := registry.NewUser() twtxtCache.Mu.RLock() - if _, ok := twtxtCache.Reg[urls]; ok { - data = twtxtCache.Reg[urls] + if _, ok := twtxtCache.Users[urls]; ok { + data = twtxtCache.Users[urls] } twtxtCache.Mu.RUnlock() @@ -173,7 +173,7 @@ func pullDatabase() { // Push the data struct (back) into // the cache. twtxtCache.Mu.Lock() - twtxtCache.Reg[urls] = data + twtxtCache.Users[urls] = data twtxtCache.Mu.Unlock() } else { |