Browse Source

fix a crash bug, and actually crash properly

master
eta 2 weeks ago
parent
commit
5aa51d6569
  1. 2
      deploy-web.txt
  2. 2
      deploy.txt
  3. 21
      trackernet.lisp

2
deploy-web.txt

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
(ql:quickload '(drakma cl-conspack cxml cl-statsd cl-redis qbase64 archive cl-ansi-text gzip-stream bobbin cl-heap hunchentoot cl-who fuzzy-match cl-json ironclad fast-websocket percent-encoding cl-stomp) :silent t)
(ql:quickload '(drakma cl-conspack cxml cl-statsd cl-redis qbase64 archive cl-ansi-text gzip-stream bobbin cl-heap hunchentoot cl-who fuzzy-match cl-json ironclad fast-websocket percent-encoding cl-stomp trivial-backtrace) :silent t)
(load "trackernet.lisp")
(load "wtt.lisp")
(load "wobsite.lisp")

2
deploy.txt

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
(ql:quickload '(drakma cl-conspack cxml cl-statsd cl-redis qbase64 archive cl-ansi-text gzip-stream bobbin cl-heap local-time log4cl ironclad cl-stomp cl-json) :silent t)
(ql:quickload '(drakma cl-conspack cxml cl-statsd cl-redis qbase64 archive cl-ansi-text gzip-stream bobbin cl-heap local-time log4cl ironclad cl-stomp cl-json trivial-backtrace) :silent t)
(load "archive-hacks.lisp")
(load "trackernet.lisp")
(require :sb-sprof)

21
trackernet.lisp

@ -1601,9 +1601,10 @@ @@ -1601,9 +1601,10 @@
(setf trains (sort trains #'<
:key (lambda (trn)
(or
(maybe-rescue-train
trn
:just-return-distance t)
(unless (uiop:string-prefix-p "X" trn)
(maybe-rescue-train
trn
:just-return-distance t))
sb-ext:double-float-positive-infinity))))
(statsd-gauge "intertube.maybe-archivable" (length trains))
(archive-trains-tar trains))))
@ -1701,6 +1702,19 @@ @@ -1701,6 +1702,19 @@
:name "elizabeth line loop")
t)
(defun debugger-hook (condition self)
(declare (ignore self))
;; attempt to inform irccat
(ignore-errors
(drakma:http-request
"http://metrics.i.eta.st:6001/send"
:method :post
:content (format nil "eta: [intertube error] ~A (on thread ~A)"
condition
(sb-thread:thread-name sb-thread:*current-thread*))))
(trivial-backtrace:print-backtrace condition)
(sb-ext:exit :abort t))
(defun main ()
(let ((*package* (find-package 'trackernet)))
(format t "~&*** Starting scraping in 3 seconds unless interrupted ***~%")
@ -1711,6 +1725,7 @@ @@ -1711,6 +1725,7 @@
(unwind-protect
(sb-impl::toplevel-repl nil)
(format t "~&*** REPL closed, continuing anyway ***~%")
(setf *debugger-hook* #'debugger-hook)
(loop (sleep 1)))))
(defun line-track-descriptions (line-code)

Loading…
Cancel
Save