Compare commits

...

2 Commits

Author SHA1 Message Date
eta 1a8ac5cdc1 that was a mistake 3 weeks ago
eta cff6ea4937 fixup deploy scripts 3 weeks ago
  1. 3
      deploy-web.sh
  2. 2
      deploy.sh
  3. 18
      trackernet.lisp

3
deploy-web.sh

@ -1,3 +1,2 @@ @@ -1,3 +1,2 @@
#!/bin/sh
echo '*** NB: press Enter after the text stops scrolling past!'
sbcl < deploy-web.txt
sbcl --noinform --disable-debugger --load deploy-web.txt

2
deploy.sh

@ -1,2 +1,2 @@ @@ -1,2 +1,2 @@
#!/bin/sh
sbcl --noinform --load deploy.txt
sbcl --noinform --disable-debugger --load deploy.txt

18
trackernet.lisp

@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@
(defparameter *rescue-grace-period-secs* 15)
(defparameter *train-active-expiry-secs-real* 360)
(defparameter *xr-train-expiry-secs* (* 3600 3))
(defparameter *xr-train-rescue-secs* 10)
(defparameter *live-train-expiry-secs* 600)
(defparameter *xr-live-train-expiry-secs* 3600)
(defparameter *train-set-code-expiry-secs* 360)
@ -1247,7 +1248,10 @@ @@ -1247,7 +1248,10 @@
:if-does-not-exist :create
:if-exists :append)
(dolist (key keys)
(when (and (or (uiop:string-prefix-p "X" key)
(if (and (or (and
(uiop:string-prefix-p "X" key)
(> (redis-last-score key)
(- (get-universal-time) *xr-train-rescue-secs*)))
(> (redis-last-score key)
(- (get-universal-time) *train-active-expiry-secs-real*)))
(< (redis-sorted-set-length key) *train-live-data-limit*)
@ -1260,12 +1264,12 @@ @@ -1260,12 +1264,12 @@
(bgcol :cyan) key (colreset) new-code dist timediff (format-path path))))
(error (e)
(log:error "failed to rescue ~A! ~A" key e)
(statsd-inc "intertube.rescue-fails"))))
(multiple-value-bind (num-recs last-data unique-tracks)
(archive-train tar key)
(when num-recs
(log:info "~Aarchived ~A~A, ~A recs / ~A uniq-trks, last: ~A"
(bgcol :red) key (colreset) num-recs unique-tracks last-data))))))
(statsd-inc "intertube.rescue-fails")))
(multiple-value-bind (num-recs last-data unique-tracks)
(archive-train tar key)
(when num-recs
(log:info "~Aarchived ~A~A, ~A recs / ~A uniq-trks, last: ~A"
(bgcol :red) key (colreset) num-recs unique-tracks last-data)))))))
(defun archive-all-trains ()
"Archive every single currently active train; start afresh with a clean slate."

Loading…
Cancel
Save