Megatest

Check-in [9a780869ba]
Login
Overview
Comment:Formalize /tmp directory creation for consistent usage and ultimately to accomodate second sync to dashboard on readonly
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.80
Files: files | file ages | folders
SHA1: 9a780869ba030b6bb92f8c29cfe0d661f1e4c5ac
User & Date: matt on 2023-05-14 20:36:20
Other Links: branch diff | manifest | tags
Context
2023-05-20
21:49
Turn busy throttle back on but with fixed 15 second delay. check-in: 218ab3d565 user: matt tags: v1.80
2023-05-14
20:36
Formalize /tmp directory creation for consistent usage and ultimately to accomodate second sync to dashboard on readonly check-in: 9a780869ba user: matt tags: v1.80
2023-05-13
22:37
Remove traces of inmem check-in: 5a507eea4f user: matt tags: v1.80
Changes

Modified dbfile.scm from [c2d21d64d9] to [10490588b1].

196
197
198
199
200
201
202




203
204
205
206
207
208
209
	   subdbs)
           #t
          )
          #f
  )
)






(define (dbfile:run-id->path apath run-id)
  (conc apath"/"(dbfile:run-id->dbname run-id)))

(define (db:dbname->path apath dbname)
  (conc apath"/"dbname))








>
>
>
>







196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
	   subdbs)
           #t
          )
          #f
  )
)

(define (dbfile:make-tmpdir-name areapath)
  (let* ((dname (conc "/tmp/"(current-user-name)"/" (string-translate areapath "/" "."))))
    (create-directory dname #t)
    dname))

(define (dbfile:run-id->path apath run-id)
  (conc apath"/"(dbfile:run-id->dbname run-id)))

(define (db:dbname->path apath dbname)
  (conc apath"/"dbname))

Modified dbmod.scm from [659c649b0a] to [a718e7bdcb].

171
172
173
174
175
176
177

178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
;; Returns dbstruct
;;
;; * This routine creates the db if not found
;; * Probably can get rid of the dbstruct-in
;; 
(define (dbmod:open-dbmoddb areapath run-id dbfname-in init-proc keys
			    #!key (dbstruct-in #f)

			    (syncdir 'todisk))
  (let* ((dbstruct     (or dbstruct-in (make-dbr:dbstruct areapath: areapath)))
	 (dbfname      (or dbfname-in (dbmod:run-id->dbfname run-id)))
	 (dbpath       (dbmod:get-dbdir dbstruct))             ;; directory where all the .db files are kept
	 (dbfullname   (conc dbpath"/"dbfname)) ;; (dbmod:run-id->full-dbfname dbstruct run-id))
	 (dbexists     (file-exists? dbfullname))
	 (tmpdir       (conc "/tmp/"(current-user-name)))
	 (tmpdb        (let* ((fname (conc tmpdir"/" (string-translate areapath "/" ".") ;; "-"(current-process-id)
					   "-"dbfname)))
			 (if (not (file-exists? tmpdir))(create-directory tmpdir))
			 ;; check if tmpdb already exists, either delete it or
			 ;; add something to the name
			 fname))
	 (cachedb        (dbmod:open-cachedb-db init-proc
					    ;; (if (eq? (dbfile:cache-method) 'cachedb)
					    ;; 	#f
					    tmpdb
					    ;; )
					    ))







>
|





|
|
<
<
<
<







171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186




187
188
189
190
191
192
193
;; Returns dbstruct
;;
;; * This routine creates the db if not found
;; * Probably can get rid of the dbstruct-in
;; 
(define (dbmod:open-dbmoddb areapath run-id dbfname-in init-proc keys
			    #!key (dbstruct-in #f)
			    ;; (dbcontext 'megatest) ;; use dashboard to do the dashboard 
			    (syncdir 'todisk)) ;; todisk is used when caching in /tmp and writing data back to MTRAH
  (let* ((dbstruct     (or dbstruct-in (make-dbr:dbstruct areapath: areapath)))
	 (dbfname      (or dbfname-in (dbmod:run-id->dbfname run-id)))
	 (dbpath       (dbmod:get-dbdir dbstruct))             ;; directory where all the .db files are kept
	 (dbfullname   (conc dbpath"/"dbfname)) ;; (dbmod:run-id->full-dbfname dbstruct run-id))
	 (dbexists     (file-exists? dbfullname))
	 (tmpdir       (dbfile:make-tmpdir-name areapath))
	 (tmpdb        (let* ((fname (conc tmpdir"/"dbfname)))




			 fname))
	 (cachedb        (dbmod:open-cachedb-db init-proc
					    ;; (if (eq? (dbfile:cache-method) 'cachedb)
					    ;; 	#f
					    tmpdb
					    ;; )
					    ))