1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-30 09:50:55 +00:00

tests: Don't hardcode GetCommandsOfType

This commit is contained in:
Kane York 2016-05-21 11:29:12 -07:00
parent ddedb404e1
commit 814f25ad53

View file

@ -195,13 +195,13 @@ func SaveLastMessage(which map[Command]map[string]LastSavedMessage, locker sync.
}
func GetCommandsOfType(match BacklogCacheType) []Command {
if match == CacheTypePersistent {
return PersistentCachingCommands
} else if match == CacheTypeLastOnly {
return HourlyCachingCommands
} else {
panic("unknown caching type")
var ret []Command
for cmd, info := range S2CCommandsCacheInfo {
if info.Caching == match {
ret = append(ret, cmd)
}
}
return ret
}
func HTTPBackendDropBacklog(w http.ResponseWriter, r *http.Request) {