We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d037d41 commit 54ce94eCopy full SHA for 54ce94e
src-clj/libmisc_clj/vars.clj
@@ -1,6 +1,11 @@
1
(ns libmisc-clj.vars)
2
3
-(defonce ^:static ttl_1m (* 1000 60)) ;seconds @ minute
4
-(defonce ^:static ttl_1h (* ttl_1m 60)) ;mins @ hour
5
-(defonce ^:static ttl_1d (* ttl_1h 24)) ;day
6
-(defonce ^:static ttl_1w (* ttl_1d 7)) ;week
+(defonce ^:const ^:static ttl_1m (* 1000 60)) ;seconds @ minute
+(defonce ^:const ^:static ttl_1h (* ttl_1m 60)) ;mins @ hour
+(defonce ^:const ^:static ttl_1d (* ttl_1h 24)) ;day
+(defonce ^:const ^:static ttl_1w (* ttl_1d 7)) ;week
7
+
8
+(def ^:const ^:static time-units-ms
9
+ (apply hash-map
10
+ (interleave [:millisecond :second :minute :hour :day :week]
11
+ (reductions * [1 1000 60 60 24 7]))))
0 commit comments