If the API queries return errors specifically stating that requested
object doesn't exist, then delete the entry from the local cache.
case reply := <-udpChan:
if reply.Code() == 330 {
cache.MarkInvalid(keys...)
case reply := <-udpChan:
if reply.Code() == 330 {
cache.MarkInvalid(keys...)
+ // deleted AID?
+ cache.Delete(keys...)
}
} else if reply.Code() == 340 {
cache.MarkInvalid(keys...)
}
} else if reply.Code() == 340 {
cache.MarkInvalid(keys...)
+ cache.Delete(keys...) // deleted EID?
- // if this is somehow still a miss, then the EID<->AID map broke
- cache.Delete("aid", "by-eid", eid)
+
+ // check to see if we looked in the right AID
+ found := false
+ if a != nil {
+ for _, ep := range a.Episodes {
+ if eid == ep.EID {
+ found = true
+ break
+ }
+ }
+ }
+
+ // if found, then it's just that the anime is also stale (offline?)
+ if found {
+ break
+ } else {
+ // otherwise, the EID<->AID map broke
+ cache.Delete("aid", "by-eid", eid)
+ }
}
}
intentMap.Notify(e, keys...)
}
}
intentMap.Notify(e, keys...)
cache.Set(g, keys...)
} else if reply.Code() == 350 {
cache.MarkInvalid(keys...)
cache.Set(g, keys...)
} else if reply.Code() == 350 {
cache.MarkInvalid(keys...)
+ cache.Delete(keys...) // deleted group?
}
intentMap.Notify(g, keys...)
}
intentMap.Notify(g, keys...)
cache.Set(g, "gid", gid)
} else if reply.Code() == 350 {
cache.MarkInvalid(keys...)
cache.Set(g, "gid", gid)
} else if reply.Code() == 350 {
cache.MarkInvalid(keys...)
+ cache.Delete(keys...) // renamed group?
+ cache.Delete(altKeys...)
}
intentMap.Notify(gid, keys...)
}
intentMap.Notify(gid, keys...)