187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
newmutex)))
(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))))
(if (not readonly-command)
(mutex-lock! write-mutex))
(let* ((res
(if writecmd-in-readonly-mode
(conc "attempt to run write command "cmd" on a read-only database")
(api:dispatch-request dbstruct cmd run-id params))))
(if (not readonly-command)
(mutex-unlock! write-mutex))
;; save all stats
(let ((delta-t (- (current-milliseconds)
start-t))
(modified-cmd (if (eq? cmd 'general-call)
|
>
>
|
>
|
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
|
newmutex)))
(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))))
(if (not readonly-command)
(mutex-lock! write-mutex))
(let* ((tmppath (dbr:dbstruct-tmppath dbstruct))
(crumbfile (dbfile:wait-for-qif tmppath run-id (cons cmd params)))
(res
(if writecmd-in-readonly-mode
(conc "attempt to run write command "cmd" on a read-only database")
(api:dispatch-request dbstruct cmd run-id params))))
(delete-file* crumbfile)
(if (not readonly-command)
(mutex-unlock! write-mutex))
;; save all stats
(let ((delta-t (- (current-milliseconds)
start-t))
(modified-cmd (if (eq? cmd 'general-call)
|