Index: dbfile.scm ================================================================== --- dbfile.scm +++ dbfile.scm @@ -896,11 +896,12 @@ ) ) tbls) (let* ((runtime (- (current-milliseconds) start-time)) (should-print (or ;; (debug:debug-mode 12) - (common:low-noise-print 120 "db sync" (> runtime 500))))) ;; low and high sync times treated as separate. + (common:low-noise-print 120 "db sync") + (> runtime 500)))) ;; low and high sync times treated as separate. (for-each (lambda (dat) (let ((tblname (car dat)) (count (cdr dat))) (set! tot-count (+ tot-count count)) @@ -1038,37 +1039,31 @@ (if (not (file-exists? destdir))(create-directory (conc destdir"/attic") #t)) (let loop ((count 0)) (let* ((currlks (glob (conc destdir"/*"))) (numqrys (length currlks)) (delayval (cond ;; do a droopish curve - ((> numqrys 50) - (if (> numqrys 50) - (for-each - (lambda (f) - (if (> (- (current-seconds) - (handle-exceptions - exn - (current-seconds) ;; file is likely gone, just fake out - (file-modification-time f))) - (keep-age-param)) - (let* ((basedir (pathname-directory f)) - (filen (pathname-file f)) - (destf (conc basedir"/attic/"filen))) - (dbfile:print-err "Moving qif file "f" older than 10 seconds to "destf) - ;; (delete-file* f) - (handle-exceptions - exn - #t - (file-move f destf #t))))) - currlks)) - 1) ;; 50 and above => 1 - ((> numqrys 10) (dbfile:droop numqrys)) ;; slope of 1/100 - ;; ((> numqrys 30) 0.50) - ;; ((> numqrys 25) 0.20) - ;; ((> numqrys 20) 0.10) - ;; ((> numqrys 15) 0.05) - ;; ((> numqrys 10) 0.01) + ((> numqrys 25) + (for-each + (lambda (f) + (if (> (- (current-seconds) + (handle-exceptions + exn + (current-seconds) ;; file is likely gone, just fake out + (file-modification-time f))) + (keep-age-param)) + (let* ((basedir (pathname-directory f)) + (filen (pathname-file f)) + (destf (conc basedir"/attic/"filen))) + (dbfile:print-err "Moving qif file "f" older than 10 seconds to "destf) + ;; (delete-file* f) + (handle-exceptions + exn + #t + (file-move f destf #t))))) + currlks) + 4) + ((> numqrys 0) (dbfile:droop numqrys)) ;; slope of 1/100 (else #f)))) (if (and delayval (< count 5)) (begin (thread-sleep! delayval)