25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
*
(import scheme chicken data-structures extras)
(import (prefix sqlite3 sqlite3:) posix typed-records srfi-18)
(import commonmod)
(use (prefix ulex ulex:))
(define (member:print msg x lst)
(print "member-" msg ": x=" x " lst=" lst)
(member x lst))
;; Hack to make these functions visible to the refactored code, goal is to eliminate these over time.
(define (rmt:send-receive . params) #f)
(define (http-transport:close-connections . params) #f)
;; from remote defstruct in common.scm
(define (remote-conndat-set! . params) #f)
(define (remote-server-url-set! . params) #f)
(define (remote-ro-mode . params) #f)
|
<
<
<
<
|
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
*
(import scheme chicken data-structures extras)
(import (prefix sqlite3 sqlite3:) posix typed-records srfi-18)
(import commonmod)
(use (prefix ulex ulex:))
;; Hack to make these functions visible to the refactored code, goal is to eliminate these over time.
(define (rmt:send-receive . params) #f)
(define (http-transport:close-connections . params) #f)
;; from remote defstruct in common.scm
(define (remote-conndat-set! . params) #f)
(define (remote-server-url-set! . params) #f)
(define (remote-ro-mode . params) #f)
|
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
;; db stuff for local db access
(set! db:dbfile-path dbfile-path)
(set! db:setup dbsetup)
(set! apt:execute-requests exec-req)
)
(define (rmt:open-qry-close-locally log-port multi-sync-mutex cmd run-id params #!key (ro-queries '())(remretries 5))
(let* ((qry-is-write (not (member:print "#1" cmd ro-queries)))
(db-file-path (db:dbfile-path)) ;; 0))
(dbstruct-local (db:setup #t)) ;; make-dbr:dbstruct path: dbdir local: #t)))
(read-only (not (file-write-access? db-file-path)))
(start (current-milliseconds))
(resdat (if (not (and read-only qry-is-write))
(let ((v (api:execute-requests dbstruct-local (vector (symbol->string cmd) params))))
(handle-exceptions ;; there has been a long history of receiving strange errors from values returned by the client when things go wrong..
|
|
|
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
;; db stuff for local db access
(set! db:dbfile-path dbfile-path)
(set! db:setup dbsetup)
(set! apt:execute-requests exec-req)
)
(define (rmt:open-qry-close-locally log-port multi-sync-mutex cmd run-id params #!key (ro-queries '())(remretries 5))
(let* ((qry-is-write (not (member cmd ro-queries)))
(db-file-path (db:dbfile-path)) ;; 0))
(dbstruct-local (db:setup #t)) ;; make-dbr:dbstruct path: dbdir local: #t)))
(read-only (not (file-write-access? db-file-path)))
(start (current-milliseconds))
(resdat (if (not (and read-only qry-is-write))
(let ((v (api:execute-requests dbstruct-local (vector (symbol->string cmd) params))))
(handle-exceptions ;; there has been a long history of receiving strange errors from values returned by the client when things go wrong..
|
194
195
196
197
198
199
200
201
202
203
|
(define (rmtmod:send-receive-ulex ulex:conn cmd rid params attemptnum area-dat)
#f)
(use trace)(trace-call-sites #t)
(trace member rmtmod:calc-ro-mode rmt:open-qry-close-locally member:print)
)
|
|
|
190
191
192
193
194
195
196
197
198
199
|
(define (rmtmod:send-receive-ulex ulex:conn cmd rid params attemptnum area-dat)
#f)
(use trace)(trace-call-sites #t)
(trace member rmtmod:calc-ro-mode rmt:open-qry-close-locally)
)
|