225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
|
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
|
-
+
|
(if *sync-in-progress*
(debug:print 3 *default-log-port* "WARNING: overlapping calls to sync to disk")
(begin
(mutex-lock! *db-with-db-mutex*) ;; this mutex is used when overloaded or during a query that modifies the db
(set! *sync-in-progress* #t)
#;(dbmod:sync-gasket tables last-update inmem db
dbfullname syncdir)
(system (conc "megatest -db2db -from "tmpdb" -to "dbfname"&"))
(system (conc "megatest -db2db -from "tmpdb" -to "dbfullname"&"))
(mutex-unlock! *db-with-db-mutex*)
(thread-sleep! 0.5) ;; ensure at least 1/2 second down time between sync calls
(set! *sync-in-progress* #f)))))
;; (dbmod:sync-tables tables #f db inmem)
;; (if db
(dbmod:sync-gasket tables #f inmem db dbfullname 'fromdest keys) ;; ) ;; load into inmem
(dbr:dbstruct-last-update-set! dbstruct (current-seconds)) ;; should this be offset back in time by one second?
|