Overview
Comment: | Couple fixes for variable server hack |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | multi-server-hack |
Files: | files | file ages | folders |
SHA1: |
842f12e5fe3c7a144c935f25748b085d |
User & Date: | matt on 2017-03-23 17:50:36 |
Other Links: | branch diff | manifest | tags |
Context
2017-03-24
| ||
11:27 | Merged v1.63 changes to multi-server-hack check-in: 8a6ca9fd18 user: matt tags: multi-server-hack | |
2017-03-23
| ||
17:50 | Couple fixes for variable server hack check-in: 842f12e5fe user: matt tags: multi-server-hack | |
16:52 | Hack for variable number of servers (default 3) check-in: e86b57ccb0 user: matt tags: multi-server-hack | |
Changes
Modified client.scm from [3c66569adb] to [5611deb23d].
︙ | |||
76 77 78 79 80 81 82 | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | - + | (begin (debug:print-error 0 *default-log-port* "failed to start or connect to server") (exit 1)) ;; ;; Alternatively here, we can get the list of candidate servers and work our way ;; through them searching for a good one. ;; |
︙ |
Modified server.scm from [07841d493c] to [a07a79fe32].
︙ | |||
165 166 167 168 169 170 171 | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | - + - + | (define (server:get-list areapath #!key (limit #f)) (let ((fname-rx (regexp "^(|.*/)server-(\\d+)-(\\S+).log$")) (day-seconds (* 24 60 60))) ;; if the directory exists continue to get the list ;; otherwise attempt to create the logs dir and then ;; continue (if (if (directory-exists? (conc areapath "/logs")) |
︙ | |||
216 217 218 219 220 221 222 | 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | + + - - - - - - - - - - - + + + + + + + + + + + + | ;; sort by start-time descending. I.e. get the oldest first. Young servers will thus drop off ;; and servers should stick around for about two hours or so. ;; (define (server:get-best srvlst) (let ((now (current-seconds))) (sort (filter (lambda (rec) (if (and (list? rec) (> (length rec) 2)) |
︙ | |||
303 304 305 306 307 308 309 | 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | + + + + + - + | ;; no longer care if multiple servers are started by accident. older servers will drop off in time. ;; (define (server:check-if-running areapath #!key (numservers "2")) (let* ((ns (string->number (or (configf:lookup *configdat* "server" "numservers") numservers))) (servers (server:get-best (server:get-list areapath)))) ;; (print "servers: " servers " ns: " ns) (if (or (and servers (null? servers)) (not servers) (and (list? servers) |
︙ |