181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
|
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
|
-
+
|
(let* ((server-logs (glob (conc areapath "/logs/server-*.log")))
(num-serv-logs (length server-logs)))
(if (null? server-logs)
'()
(let loop ((hed (car server-logs))
(tal (cdr server-logs))
(res '()))
(let* ((mod-time (handle-exceptions
(let* ((mod-time (common:debug-handle-exceptions #t
exn
0
(file-modification-time hed))) ;; default to *very* old so log gets ignored if deleted
(down-time (- (current-seconds) mod-time))
(serv-dat (if (or (< num-serv-logs 10)
(< down-time day-seconds))
(server:logf-get-start-info hed)
|
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
|
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
|
-
+
|
(loop (server:check-if-running areapath)))))))
(define server:try-running server:run) ;; there is no more per-run servers ;; REMOVE ME. BUG.
(define (server:dotserver-age-seconds areapath)
(let ((server-file (conc areapath "/.server")))
(begin
(handle-exceptions
(common:debug-handle-exceptions #t
exn
#f
(- (current-seconds)
(file-modification-time server-file))))))
;; no longer care if multiple servers are started by accident. older servers will drop off in time.
;;
|