99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
(define (api:process-request db $) ;; the $ is the request vars proc
(let* ((cmd ($ 'cmd))
(paramsj ($ 'params))
(params (rmt:json-str->dat paramsj))
(res (api:execute-requests db cmd params)))
;; This can be here but needs controls to ensure it doesn't run more than every 4 seconds
(db:sync-to *inmemdb* *db*)
(rmt:dat->json-str
(if (or (string? res)
(list? res)
(number? res)
(boolean? res))
res
(list "ERROR" 1 cmd params res)))))
|
<
<
|
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
(define (api:process-request db $) ;; the $ is the request vars proc
(let* ((cmd ($ 'cmd))
(paramsj ($ 'params))
(params (rmt:json-str->dat paramsj))
(res (api:execute-requests db cmd params)))
;; This can be here but needs controls to ensure it doesn't run more than every 4 seconds
(rmt:dat->json-str
(if (or (string? res)
(list? res)
(number? res)
(boolean? res))
res
(list "ERROR" 1 cmd params res)))))
|