File tree Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Original file line number Diff line number Diff line change 550550 (while (.get ref)
551551 (when-let [q (.get ref)]
552552 (try
553- (let [start (System/currentTimeMillis )]
553+ (let [start (System/nanoTime )]
554554 (fsync q)
555- (let [end (System/currentTimeMillis )]
556- (Thread/sleep (long (max 0 (- fsync-interval (- end start)))))))
555+ (let [end (System/nanoTime )]
556+ (Thread/sleep (long (max 0 (- ( * 1000000 fsync-interval) (- end start)))))))
557557 (catch Throwable _)))))))
558558
559559 ; ; populate queues with pre-existing tasks
746746 " Returns a lazy sequence of tasks that can be consumed in `interval` milliseconds. This will
747747 terminate after that time has elapsed, even if there are still tasks immediately available."
748748 [qs q-name interval]
749- (let [now (System/currentTimeMillis )]
749+ (let [now (System/nanoTime )]
750750 (lazy-seq
751- (let [now' (System/currentTimeMillis )
752- remaining (- interval (- now' now))]
751+ (let [now' (System/nanoTime )
752+ remaining (- ( * 1000000 interval) (- now' now))]
753753 (when (pos? remaining)
754754 (let [task (take! qs q-name remaining ::none )]
755755 (when-not (= ::none task)
756756 (cons
757757 task
758- (interval-task-seq qs q-name (- interval (- (System/currentTimeMillis ) now)))))))))))
758+ (interval-task-seq qs q-name (- ( * 1000000 interval) (- (System/nanoTime ) now)))))))))))
759759
760760(defn complete!
761761 " Marks a task as complete."
Original file line number Diff line number Diff line change 551551 (while (.get ref)
552552 (when-let [q (.get ref)]
553553 (try
554- (let [start (System/currentTimeMillis )]
554+ (let [start (System/nanoTime )]
555555 (fsync q)
556- (let [end (System/currentTimeMillis )]
557- (Thread/sleep (long (max 0 (- fsync-interval (- end start)))))))
556+ (let [end (System/nanoTime )]
557+ (Thread/sleep (long (max 0 (- ( * 1000000 fsync-interval) (- end start)))))))
558558 (catch Throwable _)))))))
559559
560560 ; ; populate queues with pre-existing tasks
747747 " Returns a lazy sequence of tasks that can be consumed in `interval` milliseconds. This will
748748 terminate after that time has elapsed, even if there are still tasks immediately available."
749749 [qs q-name interval]
750- (let [now (System/currentTimeMillis )]
750+ (let [now (System/nanoTime )]
751751 (lazy-seq
752- (let [now' (System/currentTimeMillis )
753- remaining (- interval (- now' now))]
752+ (let [now' (System/nanoTime )
753+ remaining (- ( * 1000000 interval) (- now' now))]
754754 (when (pos? remaining)
755755 (let [task (take! qs q-name remaining ::none )]
756756 (when-not (= ::none task)
757757 (cons
758758 task
759- (interval-task-seq qs q-name (- interval (- (System/currentTimeMillis ) now)))))))))))
759+ (interval-task-seq qs q-name (- ( * 1000000 interval) (- (System/nanoTime ) now)))))))))))
760760
761761(defn complete!
762762 " Marks a task as complete."
You can’t perform that action at this time.
0 commit comments