Megatest

Check-in [0d7e0aa02d]
Login
Overview
Comment:Moved open-no-sync-db into dbfile (just an incremental move towards more modulization
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.7001-multi-db-02
Files: files | file ages | folders
SHA1: 0d7e0aa02d554696b5594d87d5a4e65dfb17a6b2
User & Date: matt on 2022-03-17 21:01:02
Other Links: branch diff | manifest | tags
Context
2022-03-20
20:49
Restarted, using tests/simplerun/thebeginning.scm. check-in: 0718a80dc4 user: matt tags: v1.7001-multi-db-02
2022-03-17
21:01
Moved open-no-sync-db into dbfile (just an incremental move towards more modulization check-in: 0d7e0aa02d user: matt tags: v1.7001-multi-db-02
2022-03-15
09:30
Disable bruteforce syncer check-in: ddefd2fc13 user: mrwellan tags: v1.7001-multi-db-02
Changes

Modified db.scm from [512a53caa2] to [723a5a9b89].

2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
		(sqlite3:execute db "DELETE FROM metadat WHERE var=?;" var))))

;;======================================================================
;; no-sync.db - small bits of data to be shared between servers
;;======================================================================

(define (db:open-no-sync-db)
  (let* ((dbpath (db:dbfile-path))
	 (dbname (conc dbpath "/no-sync.db"))
	 (db-exists (common:file-exists? dbname))
	 (db     (sqlite3:open-database dbname)))
    (sqlite3:set-busy-handler! db (sqlite3:make-busy-timeout 136000))
    (if (not db-exists)
	(begin
	  (sqlite3:execute db "PRAGMA synchronous = 0;")
	  (sqlite3:execute db "CREATE TABLE IF NOT EXISTS no_sync_metadat (var TEXT,val TEXT, CONSTRAINT no_sync_metadat_constraint UNIQUE (var));")
	  (sqlite3:execute db "PRAGMA journal_mode=WAL;")))
    db))

;; if we are not a server create a db handle. this is not finalized
;; so watch for problems. I'm still not clear if it is needed to manually
;; finalize sqlite3 dbs with the sqlite3 egg.
;;
(define (db:no-sync-db db-in)
  (mutex-lock! *db-access-mutex*)







|
<
<
<
<
<
<
<
<
<
<







2097
2098
2099
2100
2101
2102
2103
2104










2105
2106
2107
2108
2109
2110
2111
		(sqlite3:execute db "DELETE FROM metadat WHERE var=?;" var))))

;;======================================================================
;; no-sync.db - small bits of data to be shared between servers
;;======================================================================

(define (db:open-no-sync-db)
  (dbfile:open-no-syncd-db (db:dbfile-path)))











;; if we are not a server create a db handle. this is not finalized
;; so watch for problems. I'm still not clear if it is needed to manually
;; finalize sqlite3 dbs with the sqlite3 egg.
;;
(define (db:no-sync-db db-in)
  (mutex-lock! *db-access-mutex*)

Modified dbfile.scm from [ef9cf83f2b] to [79c283f752].

179
180
181
182
183
184
185

















186
187

(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)))
	


















)







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204

(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)))
	
;;======================================================================
;; no-sync.db - small bits of data to be shared between servers
;;======================================================================

(define (dbfile:open-no-sync-db dbpath)
  (let* (;; (dbpath (db:dbfile-path))
	 (dbname (conc dbpath "/no-sync.db"))
	 (db-exists (file-exists? dbname))
	 (db     (sqlite3:open-database dbname)))
    (sqlite3:set-busy-handler! db (sqlite3:make-busy-timeout 136000))
    (if (not db-exists)
	(begin
	  (sqlite3:execute db "PRAGMA synchronous = 0;")
	  (sqlite3:execute db "CREATE TABLE IF NOT EXISTS no_sync_metadat (var TEXT,val TEXT, CONSTRAINT no_sync_metadat_constraint UNIQUE (var));")
	  (sqlite3:execute db "PRAGMA journal_mode=WAL;")))
    db))


)