(userID int64, p *[]PublicPost)
| 44 | ) |
| 45 | |
| 46 | func 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 | |
| 56 | func GetPostsCache(userID int64) *[]PublicPost { |
| 57 | userPostsCache.RLock() |
no test coverage detected