210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
|
((-1) "monitor.db")
((0) "main.db")
(else (conc run-id ".db")))
#f)))
(handle-exceptions
exn
(begin
(debug:print 0 *default-log-port* "ERROR: Couldn't create path to " dbdir)
(exit 1))
(if (not (directory? dbdir))(create-directory dbdir #t)))
(if fname
(conc dbdir "/" fname)
dbdir)))
;; -1 => monitor.db
|
|
|
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
|
((-1) "monitor.db")
((0) "main.db")
(else (conc run-id ".db")))
#f)))
(handle-exceptions
exn
(begin
(debug:print-error 0 *default-log-port* "Couldn't create path to " dbdir)
(exit 1))
(if (not (directory? dbdir))(create-directory dbdir #t)))
(if fname
(conc dbdir "/" fname)
dbdir)))
;; -1 => monitor.db
|
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
|
#f)))))
(if db
db ;; merely return the already opened db
(let* ((dbfile (areadb:dbfile-path areadat run-id)) ;; not already opened, so open it
(db (if (file-exists? dbfile)
(open-database dbfile)
(begin
(debug:print 0 *default-log-port* "ERROR: I was asked to open " dbfile ", but file does not exist or is not readable.")
#f))))
(case run-id
((-1)(areadat-monitordb-set! areadat db))
((0) (areadat-maindb-set! areadat db))
(else (rundat-db-set! rundat db)))
db))))
|
|
|
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
|
#f)))))
(if db
db ;; merely return the already opened db
(let* ((dbfile (areadb:dbfile-path areadat run-id)) ;; not already opened, so open it
(db (if (file-exists? dbfile)
(open-database dbfile)
(begin
(debug:print-error 0 *default-log-port* "I was asked to open " dbfile ", but file does not exist or is not readable.")
#f))))
(case run-id
((-1)(areadat-monitordb-set! areadat db))
((0) (areadat-maindb-set! areadat db))
(else (rundat-db-set! rundat db)))
db))))
|
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
|
(let ((id (list-ref row 0))
(dat (apply make-rundat (append row (list #f #f))))) ;; add placeholders for tests and db
(print row)
(hash-table-set! runs id dat))))
(sql maindb (conc "SELECT id,"
(string-intersperse keys "||'/'||")
",runname,state,status,event_time FROM runs WHERE state != 'deleted';")))
(debug:print 0 *default-log-port* "ERROR: no main.db found at " (areadb:dbfile-path areadat 0)))
areadat))
;; given an areadat and target/runname patt fill up runs data
;;
;; ?????/
;; given a list of run-ids refresh/retrieve runs data into areadat
|
|
|
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
|
(let ((id (list-ref row 0))
(dat (apply make-rundat (append row (list #f #f))))) ;; add placeholders for tests and db
(print row)
(hash-table-set! runs id dat))))
(sql maindb (conc "SELECT id,"
(string-intersperse keys "||'/'||")
",runname,state,status,event_time FROM runs WHERE state != 'deleted';")))
(debug:print-error 0 *default-log-port* "no main.db found at " (areadb:dbfile-path areadat 0)))
areadat))
;; given an areadat and target/runname patt fill up runs data
;;
;; ?????/
;; given a list of run-ids refresh/retrieve runs data into areadat
|