MCPcopy Index your code
hub / github.com/writefreely/writefreely / GetPostsCache

Function GetPostsCache

cache.go:56–69  ·  view source on GitHub ↗
(userID int64)

Source from the content-addressed store, hash-verified

54}
55
56func GetPostsCache(userID int64) *[]PublicPost {
57 userPostsCache.RLock()
58 pci, ok := userPostsCache.users[userID]
59 userPostsCache.RUnlock()
60 if !ok {
61 return nil
62 }
63
64 if pci.Expire.Before(time.Now()) {
65 // Cache is expired
66 return nil
67 }
68 return pci.Posts
69}

Callers 1

viewMyPostsAPIFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected