summaryrefslogtreecommitdiff
path: root/Run/Que.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2020-03-30 09:12:38 -0700
committerBen Sima <ben@bsima.me>2020-03-30 09:12:38 -0700
commitef3db8a4114aa0ef66ea5f9e15bbc83e1f36f33a (patch)
treeb6e2526f0a9955bda29d5c0fdd7dd2167aefb8b3 /Run/Que.hs
parent9663e948dfce5a080bd35488e5ee339958ecf0e8 (diff)
Don't read the body until I need it
Diffstat (limited to 'Run/Que.hs')
-rw-r--r--Run/Que.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Run/Que.hs b/Run/Que.hs
index 4855c2d..8171fbe 100644
--- a/Run/Que.hs
+++ b/Run/Que.hs
@@ -88,10 +88,10 @@ routes = do
-- | Put a value on a que. Returns immediately.
Scotty.post (Scotty.regex quepath) <| do
(ns, qp) <- extract
- qdata <- Scotty.body
-- ensure namespace exists
app . modify <| upsertNamespace ns
- q <- app <| que ns qp
+ q <- app <| que ns qp
+ qdata <- Scotty.body
liftIO <| pushQue (BSL.toStrict qdata) q
return ()