[works] cleanups, wfc service architecture
- now using zj as a dep instead of just having it locally - put WFC into its own service tree this surgery is not complete, but it has been started and the repo is currently not in a botched state - deleted orphan "wsp" (web socket process) module
This commit is contained in:
+2
-10
@@ -348,7 +348,7 @@ wfcin(Sock, #request{enctype = json,
|
||||
{fd_httpd_utils:jsbad(ErrorMessage), Ctx0}
|
||||
end,
|
||||
% update cache with new context
|
||||
ok = fd_cache:set(Cookie, NewCtx),
|
||||
ok = fd_wfcd_cache:set(Cookie, NewCtx),
|
||||
Body = zj:encode(RespObj),
|
||||
Response = #response{headers = [{"content-type", "application/json"},
|
||||
{"set-cookie", ["wfc=", Cookie]}],
|
||||
@@ -366,17 +366,9 @@ wfcin(Sock, Request) ->
|
||||
Context :: wfc_eval_context:context().
|
||||
|
||||
ctx(#{<<"wfc">> := Cookie}) ->
|
||||
case fd_cache:query(Cookie) of
|
||||
case fd_wfcd_cache:query(Cookie) of
|
||||
{ok, Context} -> {Cookie, Context};
|
||||
error -> {Cookie, wfc_eval_context:default()}
|
||||
end;
|
||||
ctx(_) ->
|
||||
{fd_httpd_utils:new_cookie(), wfc_eval_context:default()}.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user