Index: newdashboard.scm ================================================================== --- newdashboard.scm +++ newdashboard.scm @@ -480,15 +480,23 @@ (keys (cdb:remote-run db:get-keys #f)) (runname "%") (testpatt "%") (keypatts (map (lambda (k)(list (vector-ref k 0) "%")) keys)) (states '()) - (statuses '())) + (statuses '()) + (nextmintime (current-milliseconds))) (iup:show (main-panel)) (iup:callback-set! *tim* "ACTION_CB" (lambda (x) - (let ((changes (run-update keys data runname keypatts testpatt states statuses 'full))) - (debug:print 0 "CHANGE(S): " (car changes) "...")))))) + ;; Want to dedicate no more than 50% of the time to this so skip if + ;; 2x delta time has not passed since last query + (if (< nextmintime (current-milliseconds)) + (let* ((starttime (current-milliseconds)) + (changes (run-update keys data runname keypatts testpatt states statuses 'full)) + (endtime (current-milliseconds))) + (set! nextmintime (+ endtime (* 2 (- endtime starttime)))) + (debug:print 11 "CHANGE(S): " (car changes) "...")) + (debug:print-info 11 "Server overloaded")))))) (newdashboard) (iup:main-loop) Index: synchash.scm ================================================================== --- synchash.scm +++ synchash.scm @@ -83,21 +83,20 @@ (lambda (id) (hash-table-delete! myhash id)) removs) (list newdat removs))) ;; synchash)) - (define *synchashes* (make-hash-table)) (define (synchash:server-get db proc synckey keynum . params) ;; (debug:print-info 2 "synckey: " synckey ", keynum: " keynum ", params: " params) - (let* ((synchash (hash-table-ref/default *synchashes* synckey #f)) - (newdat (apply (case proc - ((db:get-runs) db:get-runs) - ((db:get-tests-for-runs) db:get-tests-for-runs) - (else print)) - db params)) + (let* ((synchash (hash-table-ref/default *synchashes* synckey #f)) + (newdat (apply (case proc + ((db:get-runs) db:get-runs) + ((db:get-tests-for-runs) db:get-tests-for-runs) + (else print)) + db params)) (postdat #f) (make-indexed (lambda (x) (list (vector-ref x keynum) x)))) ;; Now process newdat based on the query type (set! postdat (case proc