Overview
Comment: | db cache can do a sync to megatest.db if it has write access. The db timestamps are used to minimize burden but this is still likely not a good idea and should be removed. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | matt-db-sync-2 | v1.62-side |
Files: | files | file ages | folders |
SHA1: |
12001d69883343b2a4fad350cdec3dce |
User & Date: | mrwellan on 2016-10-31 13:56:12 |
Other Links: | branch diff | manifest | tags |
Context
2016-10-31
| ||
15:42 | Added the refactored watchdog back check-in: 828d218b23 user: mrwellan tags: matt-db-sync-2, v1.62-side | |
13:56 | db cache can do a sync to megatest.db if it has write access. The db timestamps are used to minimize burden but this is still likely not a good idea and should be removed. check-in: 12001d6988 user: mrwellan tags: matt-db-sync-2, v1.62-side | |
10:50 | Minor clean up of local access in rmt.scm check-in: f4f12cde04 user: mrwellan tags: matt-db-sync-2, v1.62-side | |
Changes
Modified db.scm from [843bf5a690] to [4f9b8565c3].
︙ | |||
87 88 89 90 91 92 93 | 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | + + - + + - + | ;; 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 (db:get-db dbstruct run-id) (if (sqlite3:database? dbstruct) ;; pass sqlite3 databases on through dbstruct (if (pair? dbstruct) dbstruct ;; pass pair ( db . path ) on through |
︙ | |||
319 320 321 322 323 324 325 326 327 328 329 330 331 332 | 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 | + + | ;; (define (db:setup run-id #!key (local #f)) (let* ((dbdir (db:dbfile-path #f)) ;; (conc (configf:lookup *configdat* "setup" "linktree") "/.db")) (dbstruct (make-dbr:dbstruct path: dbdir local: local))) dbstruct)) ;; Open the classic megatest.db file in toppath ;; ;; NOTE: returns a dbdat not a dbstruct! ;; (define (db:open-megatest-db #!key (path #f)) (let* ((dbpath (or path (conc *toppath* "/megatest.db"))) (dbexists (file-exists? dbpath)) (db (db:lock-create-open dbpath (lambda (db) (db:initialize-main-db db) |
︙ | |||
811 812 813 814 815 816 817 | 816 817 818 819 820 821 822 823 824 825 826 827 828 829 | - | (if (eq? access-mode 'cached) (apply db:call-with-cached-db db-cmd params) (apply rmt-cmd params))) ;; return the target db handle so it can be used ;; (define (db:cache-for-read-only source target #!key (use-last-update #f)) |
︙ | |||
839 840 841 842 843 844 845 | 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 | - + + + + + + + + + + - - + + + | (define (db:call-with-cached-db proc . params) ;; first cache the db in /tmp (let* ((cname-part (conc "megatest_cache/" (common:get-testsuite-name))) (fname (conc (common:get-area-path-signature) ".db")) (cache-dir (common:get-create-writeable-dir (list (conc "/tmp/" (current-user-name) "/" cname-part) (conc "/tmp/" (current-user-name) "-" cname-part) |
︙ |