Example #1
0
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)
}
Example #2
0
func (m mcImpl) AddMulti(items []mc.Item, cb mc.RawCB) error {
	return doCB(memcache.AddMulti(m.aeCtx, mcMF2R(items)), cb)
}