48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
fail_count INTEGER DEFAULT 0,
update_time TIMESTAMP DEFAULT (strftime('%s','now')) );")
db))
(define (portlogger:open-run-close proc . params)
(let* ((fname (conc "/tmp/." (current-user-name) "-portlogger.db"))
(avail (tasks:wait-on-journal fname 10))) ;; wait up to about 10 seconds for the journal to go away
;;(common:debug-handle-exceptions #t
;; exn
;; (begin
;; ;; (release-dot-lock fname)
;; (debug:print-error 0 *default-log-port* "portlogger:open-run-close failed. " proc " " params)
;; (debug:print 0 *default-log-port* " message: " ((condition-property-accessor 'exn 'message) exn))
;; (debug:print 0 *default-log-port* "exn=" (condition->list exn))
;; (if (file-exists? fname)
|
|
|
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
fail_count INTEGER DEFAULT 0,
update_time TIMESTAMP DEFAULT (strftime('%s','now')) );")
db))
(define (portlogger:open-run-close proc . params)
(let* ((fname (conc "/tmp/." (current-user-name) "-portlogger.db"))
(avail (tasks:wait-on-journal fname 10))) ;; wait up to about 10 seconds for the journal to go away
;;(handle-exceptions
;; exn
;; (begin
;; ;; (release-dot-lock fname)
;; (debug:print-error 0 *default-log-port* "portlogger:open-run-close failed. " proc " " params)
;; (debug:print 0 *default-log-port* " message: " ((condition-property-accessor 'exn 'message) exn))
;; (debug:print 0 *default-log-port* "exn=" (condition->list exn))
;; (if (file-exists? fname)
|
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
|
;;======================================================================
(define (portlogger:main . args)
(let* ((dbfname (conc "/tmp/." (current-user-name) "-portlogger.db"))
(db (portlogger:open-db dbfname))
(numargs (length args))
(result
(common:debug-handle-exceptions #t
exn
(begin
(debug:print 0 *default-log-port* "EXCEPTION: portlogger database at " dbfname " probably overloaded or unreadable. Try removing it.")
(debug:print 0 *default-log-port* " message: " ((condition-property-accessor 'exn 'message) exn))
(print "exn=" (condition->list exn))
(debug:print 0 *default-log-port* " status: " ((condition-property-accessor 'sqlite3 'status) exn))
(print-call-chain (current-error-port))
|
|
|
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
|
;;======================================================================
(define (portlogger:main . args)
(let* ((dbfname (conc "/tmp/." (current-user-name) "-portlogger.db"))
(db (portlogger:open-db dbfname))
(numargs (length args))
(result
(handle-exceptions
exn
(begin
(debug:print 0 *default-log-port* "EXCEPTION: portlogger database at " dbfname " probably overloaded or unreadable. Try removing it.")
(debug:print 0 *default-log-port* " message: " ((condition-property-accessor 'exn 'message) exn))
(print "exn=" (condition->list exn))
(debug:print 0 *default-log-port* " status: " ((condition-property-accessor 'sqlite3 'status) exn))
(print-call-chain (current-error-port))
|