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

Function CachePosts

cache.go:46–54  ·  view source on GitHub ↗
(userID int64, p *[]PublicPost)

Source from the content-addressed store, hash-verified

44)
45
46func CachePosts(userID int64, p *[]PublicPost) {
47 close(userPostsCache.users[userID].ready)
48 userPostsCache.Lock()
49 userPostsCache.users[userID] = postsCacheItem{
50 Expire: time.Now().Add(postsCacheTime),
51 Posts: p,
52 }
53 userPostsCache.Unlock()
54}
55
56func GetPostsCache(userID int64) *[]PublicPost {
57 userPostsCache.RLock()

Callers 1

viewMyPostsAPIFunction · 0.85

Calls 1

closeFunction · 0.85

Tested by

no test coverage detected