Megatest

Check-in [18c376fe83]
Login
Overview
Comment:Use WAL mode on no-sync db
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.64
Files: files | file ages | folders
SHA1: 18c376fe83a0f451bfdf0e32f39596a564fec350
User & Date: matt on 2017-07-13 07:04:15
Other Links: branch diff | manifest | tags
Context
2017-07-13
07:38
Disabled run/remove lock using no-sync. It slows down things way too much and it seems the locking didn't help anything check-in: 15a030a849 user: matt tags: v1.64, v1.6425
07:04
Use WAL mode on no-sync db check-in: 18c376fe83 user: matt tags: v1.64
04:19
Oops. Change units for server expiration time back to hours check-in: fafe58dfc3 user: matt tags: v1.64
Changes

Modified db.scm from [08b5e15dd9] to [7264118fc3].

1847
1848
1849
1850
1851
1852
1853

1854
1855


1856
1857



1858
1859
1860
1861
1862
1863
1864
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858


1859
1860
1861
1862
1863
1864
1865
1866
1867
1868







+


+
+
-
-
+
+
+







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