faster connection-cache

This commit is contained in:
David Botton 2025-11-16 15:19:14 -05:00
parent 0e9e3b09be
commit 239da8522d

View file

@ -147,9 +147,15 @@ flushed with FLUSH-CONNECTION-CACHE or a query is made."
(defun flush-connection-cache (clog-obj) (defun flush-connection-cache (clog-obj)
"Flush connection cache if on CLOG-OBJ is located on." "Flush connection cache if on CLOG-OBJ is located on."
(when *connection-cache* (when *connection-cache*
(dolist (script (reverse *connection-cache*)) (let ((big (make-string-output-stream)))
(unless (eq script :cache) (write-string "(function(){" big)
(clog-connection:execute (connection-id clog-obj) script))) (dolist (script (reverse *connection-cache*))
(unless (eq script :cache)
(write-string script big)
(write-char #\; big)))
(write-string "})()" big)
(clog-connection:execute (connection-id clog-obj)
(get-output-stream-string big)))
(setf *connection-cache* (list :cache)))) (setf *connection-cache* (list :cache))))
;;;;;;;;;;;;; ;;;;;;;;;;;;;