mirror of
https://github.com/penpot/penpot.git
synced 2025-08-02 04:48:21 +02:00
✨ Add verify
macro for true runtime spec asserts.
This commits mainly renames the old `assert` to `verify` and adds new `assert` that laverages `:elide-asserts` on clojurescript and *assert* value on clojure. This approach enables an assert macro that does not performs any runtime checks and compiles to more performant code in both cases: development mode and production mode.
This commit is contained in:
parent
391b926397
commit
8057fb54a6
14 changed files with 126 additions and 109 deletions
|
@ -39,7 +39,7 @@
|
|||
(defn- delete-project
|
||||
"Clean deleted projects."
|
||||
[{:keys [id] :as props}]
|
||||
(us/assert ::delete-project props)
|
||||
(us/verify ::delete-project props)
|
||||
(db/with-atomic [conn db/pool]
|
||||
(-> (db/query-one conn [sql:delete-project id])
|
||||
(p/then (constantly nil)))))
|
||||
|
|
|
@ -266,7 +266,7 @@
|
|||
|
||||
(defn schedule!
|
||||
[conn {:keys [name delay props queue key] :as options}]
|
||||
(us/assert ::task-options options)
|
||||
(us/verify ::task-options options)
|
||||
(let [queue (if (string? queue) queue "default")
|
||||
duration (-> (tm/duration delay)
|
||||
(duration->pginterval))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue