Commit 535ed7fd authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[ngrams] remove logs from loader

parent 1bb7434e
...@@ -115,12 +115,12 @@ useCachedLoaderEffect { cacheEndpoint, keyFunc, loadRealData, path, state: state ...@@ -115,12 +115,12 @@ useCachedLoaderEffect { cacheEndpoint, keyFunc, loadRealData, path, state: state
R.setRef oPath path R.setRef oPath path
let key = "loader--" <> (keyFunc path) let key = "loader--" <> (keyFunc path)
log2 "[useCachedLoader] key" key -- log2 "[useCachedLoader] key" key
let keyCache = key <> "-cache" let keyCache = key <> "-cache"
localStorage <- R2.getls localStorage <- R2.getls
mState <- WSS.getItem key localStorage mState <- WSS.getItem key localStorage
mCache <- WSS.getItem keyCache localStorage mCache <- WSS.getItem keyCache localStorage
log2 "[useCachedLoader] mState" mState -- log2 "[useCachedLoader] mState" mState
launchAff_ $ do launchAff_ $ do
case mState of case mState of
Nothing -> loadRealData key keyCache localStorage Nothing -> loadRealData key keyCache localStorage
...@@ -128,17 +128,17 @@ useCachedLoaderEffect { cacheEndpoint, keyFunc, loadRealData, path, state: state ...@@ -128,17 +128,17 @@ useCachedLoaderEffect { cacheEndpoint, keyFunc, loadRealData, path, state: state
let parsed = parse stStr >>= decode let parsed = parse stStr >>= decode
case parsed of case parsed of
Left err -> do Left err -> do
liftEffect $ log2 "[useCachedLoader] err" err -- liftEffect $ log2 "[useCachedLoader] err" err
loadRealData key keyCache localStorage loadRealData key keyCache localStorage
Right (st :: st) -> do Right (st :: st) -> do
cacheReal <- cacheEndpoint path cacheReal <- cacheEndpoint path
liftEffect $ log2 "[useCachedLoader] cacheReal" cacheReal -- liftEffect $ log2 "[useCachedLoader] cacheReal" cacheReal
case mCache of case mCache of
Nothing -> do Nothing -> do
liftEffect $ log2 "[useCachedLoader] no stored cache" Nothing -- liftEffect $ log2 "[useCachedLoader] no stored cache" Nothing
loadRealData key keyCache localStorage loadRealData key keyCache localStorage
Just cache -> do Just cache -> do
liftEffect $ log2 "[useCachedLoader] stored cache" cache -- liftEffect $ log2 "[useCachedLoader] stored cache" cache
if cache == cacheReal then if cache == cacheReal then
-- yay! cache hit! -- yay! cache hit!
liftEffect $ setState $ const $ Just st liftEffect $ setState $ const $ Just st
......
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