Much work on error reporting architecture for validation
This commit is contained in:
parent
5593bb22d1
commit
25795cf364
43 changed files with 2024 additions and 1067 deletions
|
|
@ -5,136 +5,145 @@
|
|||
</head>
|
||||
<body>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
001 (ns clj-activitypub.internal.thread-cache)
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
002
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
003 (defn- current-time
|
||||
001 (ns clj-activitypub.internal.thread-cache
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
004 "Returns current time using UNIX epoch."
|
||||
002 "copied from [Jahfer's clj-activitypub library](https://github.com/jahfer/clj-activitypub).
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
005 []
|
||||
003 If and when Jahfer issues a release of that library, this directory will be deleted and a
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
006 (System/currentTimeMillis))
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
004 dependency on that library will be added to the project.")
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
007
|
||||
005
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
008 (defn- update-read-at [store k v]
|
||||
006 (defn- current-time
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
007 "Returns current time using UNIX epoch."
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
008 []
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
009 (System/currentTimeMillis))
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
010
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
011 (defn- update-read-at [store k v]
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
009 (dosync
|
||||
012 (dosync
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
010 (commute store assoc k
|
||||
013 (commute store assoc k
|
||||
</span><br/>
|
||||
<span class="covered" title="7 out of 7 forms covered">
|
||||
011 (merge v {:read-at (current-time)}))))
|
||||
014 (merge v {:read-at (current-time)}))))
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
012
|
||||
015
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
013 (defn make
|
||||
016 (defn make
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
014 "Creates a thread-local cache."
|
||||
017 "Creates a thread-local cache."
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
015 ([] (make false))
|
||||
018 ([] (make false))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
016 ([cache-if-nil]
|
||||
019 ([cache-if-nil]
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
017 (let [store (ref {})]
|
||||
020 (let [store (ref {})]
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
018 (letfn [(cache-kv ([k v]
|
||||
021 (letfn [(cache-kv ([k v]
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
019 (dosync
|
||||
022 (dosync
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
020 (commute store assoc k
|
||||
023 (commute store assoc k
|
||||
</span><br/>
|
||||
<span class="covered" title="6 out of 6 forms covered">
|
||||
021 {:write-at (current-time)
|
||||
024 {:write-at (current-time)
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
022 :read-at (current-time)
|
||||
025 :read-at (current-time)
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
023 :value v})
|
||||
026 :value v})
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
024 v)))
|
||||
027 v)))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
025 (get-v ([k]
|
||||
028 (get-v ([k]
|
||||
</span><br/>
|
||||
<span class="covered" title="11 out of 11 forms covered">
|
||||
026 (when-let [data (get @store k)]
|
||||
029 (when-let [data (get @store k)]
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
027 (update-read-at store k data)
|
||||
030 (update-read-at store k data)
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
028 (:value data)))
|
||||
031 (:value data)))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
029 ([k compute-fn]
|
||||
032 ([k compute-fn]
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
030 (let [storage @store]
|
||||
033 (let [storage @store]
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
031 (if (contains? storage k)
|
||||
034 (if (contains? storage k)
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
032 (get-v k)
|
||||
035 (get-v k)
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
033 (let [v (compute-fn)]
|
||||
036 (let [v (compute-fn)]
|
||||
</span><br/>
|
||||
<span class="partial" title="11 out of 12 forms covered">
|
||||
034 (when (or (not (nil? v)) cache-if-nil)
|
||||
037 (when (or (not (nil? v)) cache-if-nil)
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
035 (cache-kv k v)
|
||||
038 (cache-kv k v)
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
036 (get-v k)))))))
|
||||
039 (get-v k)))))))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
037 (lru ([]
|
||||
040 (lru ([]
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 2 forms covered">
|
||||
038 (mapv
|
||||
041 (mapv
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 6 forms covered">
|
||||
039 (fn [[k v]] [k (:value v)])
|
||||
042 (fn [[k v]] [k (:value v)])
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 12 forms covered">
|
||||
040 (sort-by #(-> % val :read-at) < @store))))]
|
||||
043 (sort-by #(-> % val :read-at) < @store))))]
|
||||
</span><br/>
|
||||
<span class="covered" title="6 out of 6 forms covered">
|
||||
041 {:cache-kv cache-kv
|
||||
044 {:cache-kv cache-kv
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
042 :get-v get-v
|
||||
045 :get-v get-v
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
043 :cache-if-nil cache-if-nil
|
||||
046 :cache-if-nil cache-if-nil
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
044 :lru lru}))))
|
||||
047 :lru lru}))))
|
||||
</span><br/>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue