Verified Commit 1fad38c0 authored by Camil Staps's avatar Camil Staps 🚀

Update submodule for #153; make cache keys more general to fix #154

parent 4d5afd97
Subproject commit c45e323ad558db2896f4a0bb6105e6ce03d07d73
Subproject commit 020cd4dec09649066ad224ed2664e72c0e35b40f
......@@ -58,9 +58,11 @@ derive JSONDecode Kind, Type, RequestCacheKey, TypeRestriction
instance toString RequestCacheKey
where toString rck = toString $ toJSON rck
toRequestCacheKey :: Request -> RequestCacheKey
toRequestCacheKey r =
{ c_unify = r.unify >>= parseType o fromString
toRequestCacheKey :: CloogleDB Request -> RequestCacheKey
toRequestCacheKey db r =
{ c_unify = snd <$>
prepare_unification True (map getTypeDef $ allTypes db) <$>
(parseType o fromString =<< r.unify)
, c_name = r.name
, c_className = r.className
, c_typeName = r.typeName
......@@ -164,7 +166,7 @@ where
// Suggestions
#! suggestions = unify >>= parseType o fromString >>= flip (suggs name) db
#! w = seq [cachePages
(toRequestCacheKey req) CACHE_PREFETCH 0 zero suggs
(toRequestCacheKey db req) CACHE_PREFETCH 0 zero suggs
\\ (req,suggs) <- 'Foldable'.concat suggestions] w
#! suggestions
= sortBy (\a b -> snd a > snd b) <$>
......@@ -184,7 +186,7 @@ where
// Save cache file
= respond response w
where
key = toRequestCacheKey request
key = toRequestCacheKey db request
respond :: !Response !*World -> *(!Response, !CacheKey, !*World)
respond r w = (r, cacheKey key, writeCache LongTerm key r w)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment