@@ -22,26 +22,30 @@ ;; Tasks db ;;====================================================================== ;; wait up to aprox n seconds for a journal to go away ;; -(define (tasks:wait-on-journal path n #!key (remove #f)) +(define (tasks:wait-on-journal path n #!key (remove #f)(waiting-msg #f)) (let ((fullpath (conc path "-journal"))) (handle-exceptions exn #t ;; if stuff goes wrong just allow it to move on (let loop ((journal-exists (file-exists? fullpath)) (count n)) ;; wait ten times ... (if journal-exists - (if (> count 0) - (begin - (thread-sleep! 1) - (loop (file-exists? fullpath) - (- count 1))) - (begin - (if remove (system (conc "rm -rf " path))) - #f)) + (begin + (if (and waiting-msg + (eq? (modulo n 30) 0)) + (debug:print 0 waiting-msg)) + (if (> count 0) + (begin + (thread-sleep! 1) + (loop (file-exists? fullpath) + (- count 1))) + (begin + (if remove (system (conc "rm -rf " fullpath))) + #f))) #t))))) (define (tasks:get-task-db-path) (if *task-db* (vector-ref *task-db* 1)