cache the names of functions returning JWT and avoid extra query on each rpc call

This commit is contained in:
Ruslan Talpa
2016-06-28 12:09:58 +03:00
parent a253ff325d
commit 744bbf7203
3 changed files with 14 additions and 20 deletions
+2 -1
View File
@@ -188,9 +188,10 @@ app dbStructure conf apiRequest =
Just (PayloadJSON (UniformObjects payload))) -> do
let p = V.head payload
jwtSecret = configJwtSecret conf
returnJWT = qiName qi `elem` dbProcsReturningJWT dbStructure
respondToRange $ do
row <- H.query () (callProc qi p topLevelRange shouldCount)
returnJWT <- H.query qi doesProcReturnJWT
--returnJWT <- H.query qi doesProcReturnJWT
let (tableTotal, queryTotal, body) = fromMaybe (Just 0, 0, emptyArray) row
(status, contentRange) = rangeHeader queryTotal tableTotal
in