377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
| (debug:print-info 0 *default-log-port* "Keep running, I'm the top server.")
(if db-locked-in
#t
(let* ((lockinfo (dbfile:with-no-sync-db nosyncdbpath
(lambda (db)
(db:no-sync-get-lock db dbfname))))
(success (car lockinfo)))
success)))
(else
(debug:print-info 0 *default-log-port* "I'm not the lead server: "servers)
(let* ((leadsrv (car servers)))
(match leadsrv
((host port startseconds server-id pid dbfname servinfofile)
(if (tt:ping host port server-id)
#f ;; not the server, but all good, want to exit
|
|
>
>
>
>
>
>
| 377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
| (debug:print-info 0 *default-log-port* "Keep running, I'm the top server.")
(if db-locked-in
#t
(let* ((lockinfo (dbfile:with-no-sync-db nosyncdbpath
(lambda (db)
(db:no-sync-get-lock db dbfname))))
(success (car lockinfo)))
(if success
(begin
(debug:print 0 *default-log-port* "Got server lock for "dbfname)
#t)
(begin
(debug:print 0 *default-log-port* "Failed to get server lock for "dbfname)
#f)))))
(else
(debug:print-info 0 *default-log-port* "I'm not the lead server: "servers)
(let* ((leadsrv (car servers)))
(match leadsrv
((host port startseconds server-id pid dbfname servinfofile)
(if (tt:ping host port server-id)
#f ;; not the server, but all good, want to exit
|