573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
|
;; 3. gather the lock entries, apply the "winner" heuristic
;; 4. if I'm the winner, set tt-state to 'running else set to 'notthewinner
;;
;; New idea:
;; 1. check all processes entries that match the db
;; 2. sort by fixed heuristic
;; 3. if I'm number one, set state to 'running and db-locked-in to #t
(let* ((candidates (map dbfile:row->procinfo
(dbfile:with-no-sync-db
nosyncdbpath
(lambda (nsdb)
(dbfile:get-process-options nsdb "server" dbfname)))))
(primecand (begin
(assert (not (null? candidates))
"HOW CAN WE NOT BE IN THE PROCESSES DB AS A SERVER?")
|
|
|
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
|
;; 3. gather the lock entries, apply the "winner" heuristic
;; 4. if I'm the winner, set tt-state to 'running else set to 'notthewinner
;;
;; New idea:
;; 1. check all processes entries that match the db
;; 2. sort by fixed heuristic
;; 3. if I'm number one, set state to 'running and db-locked-in to #t
(let* ((candidates (map dbfile:row->procinf
(dbfile:with-no-sync-db
nosyncdbpath
(lambda (nsdb)
(dbfile:get-process-options nsdb "server" dbfname)))))
(primecand (begin
(assert (not (null? candidates))
"HOW CAN WE NOT BE IN THE PROCESSES DB AS A SERVER?")
|