Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -4047,11 +4047,11 @@ ;; The function takes two arguments: dbstruct, which represents the database structure, and since-time, which is a timestamp indicating the time of the last update. ;; The function first defines a few helper functions, including backcons, which takes a list and an item and adds the item to the front of the list. ;; It then initializes several variables to empty lists: all_tests, all_test_steps, all_test_data, all_run_ids, and all_test_ids. ;; The function then retrieves a list of IDs for runs that have been changed since since-time using the db:get-changed-run-ids function. -;; It then filters the full list of run IDs to only include those that match the changed run IDs based on their modulo 100. +;; It then filters the full list of run IDs to only include those that match the changed run IDs based on their modulo (num-run-dbs). ;; For each changed run ID, the function retrieves a list of test IDs, test step IDs, and test data IDs that have been updated since since-time. ;; It appends these IDs to the appropriate lists (all_tests, all_test_steps, and all_test_data) using the append and map functions. ;; The function then retrieves a list of run stat IDs that have been updated since since-time. ;; Finally, the function returns a list of associations between record types and their corresponding IDs: runs, tests, test_steps, test_data, and run_stats. ;; @@ -4064,11 +4064,11 @@ (db:with-db dbstruct #f #f (lambda (dbdat db) (sqlite3:fold-row backcons '() db "SELECT id FROM runs")) ) ) - (changed_run_ids (filter (lambda (run) (member (modulo run 100) changed_run_dbs)) all_run_ids)) + (changed_run_ids (filter (lambda (run) (member (modulo run (num-run-dbs)) changed_run_dbs)) all_run_ids)) (run_ids (db:with-db dbstruct #f #f (lambda (dbdat db) (sqlite3:fold-row backcons '() db "SELECT id FROM runs WHERE last_update>=?" since-time)) ) Index: tasks.scm ================================================================== --- tasks.scm +++ tasks.scm @@ -1058,11 +1058,11 @@ (run-ids (if (and target run-name) (rmt:get-run-record-ids target run-name (rmt:get-keys)) (rmt:get-changed-record-run-ids last-sync-time))) (all-run-ids (if (and target run-name) '() (rmt:get-all-runids))) (changed-run-dbs (if (and target run-name) '() (db:get-changed-run-ids last-sync-time))) - (changed-run-ids (if (and target run-name) run-ids (filter (lambda (run) (member (modulo run 100) changed-run-dbs)) all-run-ids))) + (changed-run-ids (if (and target run-name) run-ids (filter (lambda (run) (member (modulo run (num-run-dbs)) changed-run-dbs)) all-run-ids))) (area-tag (if (args:get-arg "-area-tag") (args:get-arg "-area-tag") (if (args:get-arg "-area") (args:get-arg "-area") ""))))