113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
-
+
|
result)))
;; Given a run id start a server process ### NOTE ### > file 2>&1
;; if the run-id is zero and the target-host is set
;; try running on that host
;; incidental: rotate logs in logs/ dir.
;;
(define (server:run areapath) ;; areapath is ignored for now.
(define (server:run areapath) ;; areapath is *toppath* for a given testsuite area
(let* ((curr-host (get-host-name))
(attempt-in-progress (server:start-attempted? areapath))
(dot-server-url (server:check-if-running areapath))
(curr-ip (server:get-best-guess-address curr-host))
(curr-pid (current-process-id))
(homehost (common:get-homehost)) ;; configf:lookup *configdat* "server" "homehost" ))
(target-host (car homehost))
|
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
174
175
176
177
178
179
180
181
182
183
184
185
186
187
|
-
-
-
-
-
-
|
(let ((last-run-time (hash-table-ref/default *server-kind-run* areapath #f)))
(if (or (not last-run-time)
(> (- (current-seconds) last-run-time) 30))
(begin
(server:run areapath)
(hash-table-set! *server-kind-run* areapath (current-seconds))))))
;; The generic run a server command. Dispatches the call to server 0 if run-id != 0
;;
;; (define (server:try-running run-id)
;; (if (eq? run-id 0)
;; (server:run run-id)
;; (rmt:start-server run-id)))
(define server:try-running server:run) ;; there is no more per-run servers ;; REMOVE ME. BUG.
(define (server:attempting-start areapath)
(with-output-to-file
(conc areapath "/.starting-server")
(lambda ()
(print (current-process-id) " on " (get-host-name)))))
|