Overview
Comment: | missing edits |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | v1.7001-multi-db-02 |
Files: | files | file ages | folders |
SHA1: |
745600bad31ffde4b4ffa494ef58fdde |
User & Date: | mrwellan on 2022-03-14 14:31:34 |
Other Links: | branch diff | manifest | tags |
Context
2022-03-15
| ||
09:30 | Disable bruteforce syncer check-in: ddefd2fc13 user: mrwellan tags: v1.7001-multi-db-02 | |
2022-03-14
| ||
14:31 | missing edits check-in: 745600bad3 user: mrwellan tags: v1.7001-multi-db-02 | |
2022-03-13
| ||
20:27 | wip check-in: cd75b861ad user: matt tags: v1.7001-multi-db-02 | |
Changes
Modified Makefile from [d5e6715cc1] to [038da046bd].
︙ | ︙ | |||
26 27 28 29 30 31 32 | process.scm runs.scm tasks.scm tests.scm genexample.scm \ http-transport.scm filedb.scm tdb.scm client.scm mt.scm \ ezsteps.scm lock-queue.scm sdb.scm rmt.scm api.scm \ subrun.scm portlogger.scm archive.scm env.scm \ diff-report.scm cgisetup/models/pgdb.scm # module source files | | | | | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | process.scm runs.scm tasks.scm tests.scm genexample.scm \ http-transport.scm filedb.scm tdb.scm client.scm mt.scm \ ezsteps.scm lock-queue.scm sdb.scm rmt.scm api.scm \ subrun.scm portlogger.scm archive.scm env.scm \ diff-report.scm cgisetup/models/pgdb.scm # module source files MSRCFILES = dbmod.scm dbfile.scm debugprint.scm mtargs.scm mofiles/dbfile.o : mofiles/debugprint.o mofiles/debugprint.o : mofiles/mtargs.o # ftail.scm rmtmod.scm commonmod.scm removed # MSRCFILES = ducttape-lib.scm pkts.scm stml2.scm cookie.scm mutils.scm \ # mtargs.scm commonmod.scm dbmod.scm adjutant.scm ulex.scm \ # rmtmod.scm apimod.scm GUISRCF = dashboard-context-menu.scm dashboard-tests.scm \ |
︙ | ︙ |
Modified dbfile.scm from [ac7098dfd2] to [ef9cf83f2b].
︙ | ︙ | |||
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | (define (db:run-id->dbname run-id) (cond ((number? run-id) (conc ".db/" (modulo run-id 100) ".db")) ((not run-id) (conc ".db/main.db")) (else run-id))) ;; Get/open a database ;; if run-id => get run specific db ;; if #f => get main db ;; if run-id is a string treat it as a filename ;; if db already open - return inmem ;; if db not open, open inmem, rundb and sync then return inmem ;; inuse gets set automatically for rundb's ;; (define (dbfile:get-dbh dbstruct run-id) ;; RENAME TO db:get-dbh (let* ((subdb (dbfile:get-subdb dbstruct run-id))) (if (stack? (dbr:subdb-dbstack subdb)) (if (stack-empty? (dbr:subdb-dbstack subdb)) #f (stack-pop! (dbr:subdb-dbstack subdb))) #f))) | > > > > | | | 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | (define (db:run-id->dbname run-id) (cond ((number? run-id) (conc ".db/" (modulo run-id 100) ".db")) ((not run-id) (conc ".db/main.db")) (else run-id))) (define (dbfile:get-subdb dbstruct run-id) (let* ((dbfname (db:run-id->dbname run-id))) (hash-table-ref/default (dbr:dbstruct-subdbs dbstruct) dbfname #f))) ;; Get/open a database ;; if run-id => get run specific db ;; if #f => get main db ;; if run-id is a string treat it as a filename ;; if db already open - return inmem ;; if db not open, open inmem, rundb and sync then return inmem ;; inuse gets set automatically for rundb's ;; (define (dbfile:get-dbh dbstruct run-id) ;; RENAME TO db:get-dbh (let* ((subdb (dbfile:get-subdb dbstruct run-id))) (if (stack? (dbr:subdb-dbstack subdb)) (if (stack-empty? (dbr:subdb-dbstack subdb)) #f (stack-pop! (dbr:subdb-dbstack subdb))) #f))) (define (dbfile:add-dbh dbstruct run-id dbh) (let* ((subdb (dbfile:get-subdb dbstruct run-id))) (if (not (stack? (dbr:subdb-dbstack subdb))) (dbr:subdb-dbstack-set! subdb (make-stack))) (stack-push! (dbr:subdb-dbstack subdb) dbh))) ) |