       (interspaced db-gc-millis #(garbage-collect! db) job-pool)
 
       (when (pos? node-ttl-seconds)
-        (interspaced db-gc-millis #(auto-deactivate-nodes! db node-ttl-seconds) job-pool :initial-delay (* db-gc-millis 1/4)))
+        (interspaced db-gc-millis #(auto-deactivate-nodes! db (secs node-ttl-seconds)) job-pool :initial-delay (* db-gc-millis 1/4)))
 
       (when (pos? node-purge-ttl-seconds)
-        (interspaced db-gc-millis #(purge-nodes! db node-purge-ttl-seconds) job-pool :initial-delay (* db-gc-millis 2/4)))
+        (interspaced db-gc-millis #(purge-nodes! db (secs node-purge-ttl-seconds)) job-pool :initial-delay (* db-gc-millis 2/4)))
 
       (when (pos? report-ttl-seconds)
-            (interspaced db-gc-millis #(sweep-reports! db report-ttl-seconds) job-pool :initial-delay (* db-gc-millis 3/4)))
+            (interspaced db-gc-millis #(sweep-reports! db (secs report-ttl-seconds)) job-pool :initial-delay (* db-gc-millis 3/4)))
 
       ;; Start debug REPL if necessary
       (let [{:keys [enabled type host port] :or {type "nrepl" host "localhost"}} (:repl config)]

  (try
    (pl-utils/demarcate
      (format "purge deactivated nodes (threshold: %s)"
              (format-period (secs node-purge-ttl-seconds)))
      (with-transacted-connection db
        (scf-store/purge-deactivated-nodes! (ago (secs node-purge-ttl-seconds)))))
    (catch Exception e
      (log/error e "Error while purging deactivated nodes"))))


  (try
    (pl-utils/demarcate
      (format "sweep of stale nodes (threshold: %s)"
              (format-period node-ttl-seconds))
      (with-transacted-connection db
        (doseq [node (scf-store/stale-nodes (ago node-ttl-seconds))]
          (send-command! "deactivate node" 1 (json/generate-string node)))))
    (catch Exception e
      (log/error e "Error while deactivating stale nodes"))))
