aboutsummaryrefslogtreecommitdiff
path: root/src/com/github/ivarref/yoltq/ext_sys.clj
diff options
context:
space:
mode:
authorIvar Refsdal <refsdal.ivar@gmail.com>2022-03-27 18:39:44 +0200
committerIvar Refsdal <refsdal.ivar@gmail.com>2022-03-27 18:39:44 +0200
commit6c26a3b6871286510bb8e9770ee7f7e3abf97abe (patch)
treee5b831db0f727c77255df58edd7e07275c7bb4d0 /src/com/github/ivarref/yoltq/ext_sys.clj
parentDocument (diff)
downloadfiinha-6c26a3b6871286510bb8e9770ee7f7e3abf97abe.tar.gz
fiinha-6c26a3b6871286510bb8e9770ee7f7e3abf97abe.tar.xz
Start use current millis in the database, not nano offset
Diffstat (limited to 'src/com/github/ivarref/yoltq/ext_sys.clj')
-rw-r--r--src/com/github/ivarref/yoltq/ext_sys.clj13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/com/github/ivarref/yoltq/ext_sys.clj b/src/com/github/ivarref/yoltq/ext_sys.clj
index 3480475..692b934 100644
--- a/src/com/github/ivarref/yoltq/ext_sys.clj
+++ b/src/com/github/ivarref/yoltq/ext_sys.clj
@@ -1,17 +1,18 @@
(ns com.github.ivarref.yoltq.ext-sys
(:require [datomic.api :as d])
+ (:refer-clojure :exclude [random-uuid])
(:import (java.util UUID)))
-(def ^:dynamic *now-ns-atom* nil)
+(def ^:dynamic *now-ms-atom* nil)
(def ^:dynamic *squuid-atom* nil)
(def ^:dynamic *random-atom* nil)
-(defn now-ns []
- (if *now-ns-atom*
- @*now-ns-atom*
- (System/nanoTime)))
+(defn now-ms []
+ (if *now-ms-atom*
+ @*now-ms-atom*
+ (System/currentTimeMillis)))
(defn squuid []
@@ -23,4 +24,4 @@
(defn random-uuid []
(if *random-atom*
(UUID/fromString (str "00000000-0000-0000-0000-" (format "%012d" (swap! *random-atom* inc))))
- (UUID/randomUUID))) \ No newline at end of file
+ (UUID/randomUUID)))