396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
|
;;
(define (api:execute-requests dbstruct cmd params)
(let* ((start-t (current-milliseconds))
;; (readonly-mode (dbr:dbstruct-read-only dbstruct))
;; (readonly-command (member cmd api:read-only-queries))
;; (writecmd-in-readonly-mode (and readonly-mode (not readonly-command)))
(res (api:dispatch-cmd dbstruct cmd params)))
;; (if writecmd-in-readonly-mode
;; (conc "attempt to run write command "cmd" on a read-only database")
;; save all stats
(let ((delta-t (- (current-milliseconds)
start-t)))
(hash-table-set! *db-api-call-time* cmd
(cons delta-t (hash-table-ref/default *db-api-call-time* cmd '()))))
res))
;; (if #f ;; writecmd-in-readonly-mode
;; (begin
;; (vector #f res))
;; (begin
;; (vector #t res))))))))
|
<
>
>
>
|
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
|
;;
(define (api:execute-requests dbstruct cmd params)
(let* ((start-t (current-milliseconds))
;; (readonly-mode (dbr:dbstruct-read-only dbstruct))
;; (readonly-command (member cmd api:read-only-queries))
;; (writecmd-in-readonly-mode (and readonly-mode (not readonly-command)))
(res (api:dispatch-cmd dbstruct cmd params)))
;; (if writecmd-in-readonly-mode
;; (conc "attempt to run write command "cmd" on a read-only database")
;; save all stats
(let ((delta-t (- (current-milliseconds)
start-t)))
(hash-table-set! *db-api-call-time* cmd
(cons delta-t (hash-table-ref/default *db-api-call-time* cmd '()))))
(assert (not (eof-object? res))
(conc "FATAL: eof not allowed as returned value. "cmd", "params))
res))
;; (if #f ;; writecmd-in-readonly-mode
;; (begin
;; (vector #f res))
;; (begin
;; (vector #t res))))))))
|