示例#1
0
文件: util.go 项目: jittuu/hivepeek
func FillTeamsCache(c *internal.DSContext) error {
	teams, err := c.GetAllTeams()
	if err != nil {
		return err
	}
	items := make([]*memcache.Item, len(teams))
	for i := range teams {
		key := fmt.Sprintf("teamID:byproviderID:%d", teams[i].ProviderID)
		items[i] = &memcache.Item{
			Key:   key,
			Value: []byte(strconv.FormatInt(teams[i].ID, 10)),
		}
	}

	return memcache.AddMulti(c, items)
}
示例#2
0
文件: memcache.go 项目: nishanths/gae
func (m mcImpl) AddMulti(items []mc.Item, cb mc.RawCB) error {
	return doCB(memcache.AddMulti(m.aeCtx, mcMF2R(items)), cb)
}