summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2009-06-26 07:31:28 +0200
committerLinus Nordberg <linus@nordberg.se>2009-06-26 07:31:28 +0200
commit837dcbb8a3e5d9424ab14dfdea04759f127635c9 (patch)
tree65ebbd0a726ed32b61249a2097b7adef43e137f1
parent67cb7c2aa62db8d40516d8c64d7a08093b5cd526 (diff)
Snob up the progress presentation.
-rw-r--r--src/bgpstore.lisp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/bgpstore.lisp b/src/bgpstore.lisp
index 4f36394..7430b8a 100644
--- a/src/bgpstore.lisp
+++ b/src/bgpstore.lisp
@@ -2,23 +2,28 @@
(defparameter *db-spec* '("bgpstore" "bgpstore" "bgpstore" "localhost" ))
+(defun marker (mark)
+ (format t mark)
+ (force-output))
+
(defun start-bgpstore (host port)
(with-connection *db-spec*
(let ((reader (new-reader host port))
(count 0))
- (format t "~A: bgpstore started~%" (iso-date (get-universal-time) t))
+ (marker (format nil "~A: bgpstore started "
+ (iso-date (get-universal-time) t)))
(do ((e (next-xml-blurb reader "BGP_MESSAGE")
(next-xml-blurb reader "BGP_MESSAGE")))
((null e))
(dolist (obj (new-entries (xml-top-elem-from-octets e)))
(insert-dao obj)
(incf count)
- (if (= 0 (mod count 100)) (format t ".")
- (if (= 0 (mod count 1000)) (format t "+")
- (if (= 0 (mod count 10000))
- (format t "~%~A: ~A "
- (iso-date (get-universal-time) t)
- count))))))
+ (when (= 0 (mod count 10)) (marker "."))
+ (when (= 0 (mod count 100)) (marker "+"))
+ (when (= 0 (mod count 1000))
+ (marker (format nil "~%~A: ~A "
+ (iso-date (get-universal-time) t)
+ count)))))
(close-reader))))
(defun stop-bgpstore ())