// HandleExpiredKeys is expired keys inspector/handler.
HandleExpiredKeys is expired keys inspector/handler.
// HandleExpiredKeys is expired keys inspector / handler .
func (s *Store) HandleExpiredKeys(keys ...string) error {
	if len(keys) == 0 {
		return nil
	}
	uniqueAnchors := make(map[string]bool)
	for _, key := range keys {
		tags, err := s.store.GetTags(key)
		if err != nil {
			logger.Errorf("get tags for expired key[%s]: %s", key, err)
			return nil
		}
		for _, tag := range tags {
			if tag.Name == anchorIndex {
				anchor, err := base64.RawURLEncoding.DecodeString(tag.Value)
				if err != nil {
					logger.Errorf("failed to decode encoded anchor[%s]: %s", tag.Value, err)
					return nil
				}
				uniqueAnchors[string(anchor)] = true
			}
		}
	}
	anchors := make([]string, 0, len(uniqueAnchors))
	for a := range uniqueAnchors {
		anchors = append(anchors, a)
	}
	logger.Errorf("failed to process anchors: %s", anchors)
	return nil
}
func ( s * Store ) HandleExpiredKeys ( keys ... string ) error { if len ( keys ) == 0 { return nil } uniqueAnchors := make ( map [ string ] bool ) for _ , key := range keys { tags , err := s . store . GetTags ( key ) if err != nil { logger . Errorf ( " " , key , err ) return nil } for _ , tag := range tags { if tag . Name == anchorIndex { anchor , err := base64 . RawURLEncoding . DecodeString ( tag . Value ) if err != nil { logger . Errorf ( " " , tag . Value , err ) return nil } uniqueAnchors [ string ( anchor ) ] = true } } } anchors := make ( [ ] string , 0 , len ( uniqueAnchors ) ) for a := range uniqueAnchors { anchors = append ( anchors , a ) } logger . Errorf ( " " , anchors ) return nil }
HandleExpiredKeys is expired keys inspector/handler.
HandleExpiredKeys is expired keys inspector / handler .