Skip to content

Commit

Permalink
should be fine to just use hash
Browse files Browse the repository at this point in the history
  • Loading branch information
dwwoelfel committed Dec 18, 2024
1 parent 456a9fa commit df9258e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions server/src/instant/reactive/query.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
[instant.jdbc.aurora :as aurora]
[instant.reactive.store :as rs]
[instant.util.instaql :refer [instaql-nodes->object-tree]]
[instant.util.tracer :as tracer]
[taoensso.nippy :as nippy])
[instant.util.tracer :as tracer])
(:import
(org.apache.commons.codec.digest DigestUtils)))

Check warning on line 18 in server/src/instant/reactive/query.clj

View workflow job for this annotation

GitHub Actions / lint

Unused import DigestUtils

Expand Down Expand Up @@ -113,8 +112,8 @@
:record-datalog-query-finish! (partial rs/record-datalog-query-finish! store-conn ctx))))))

instaql-result (iq/permissioned-query ctx instaql-query)
result-hash (DigestUtils/md5Hex (nippy/fast-freeze {:instaql-result instaql-result
:attrs (attr-model/unwrap attrs)}))
result-hash (hash {:instaql-result instaql-result
:attrs (attr-model/unwrap attrs)})
{:keys [result-changed?]} (rs/add-instaql-query! store-conn ctx result-hash)]
{:instaql-result (case return-type
:join-rows (collect-instaql-results-for-client instaql-result)
Expand Down
2 changes: 1 addition & 1 deletion server/src/instant/reactive/store.clj
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
:db/index true}
:instaql-query/stale? {:db/type :db.type/boolean}
:instaql-query/version {:db/type :db.type/integer}
:instaql-query/hash {:db/type :db.type/string}
:instaql-query/hash {:db/type :db.type/number}
;; This would be easier if we had a store per app
:instaql-query/session-id+query
{:db/tupleAttrs [:instaql-query/session-id :instaql-query/query]
Expand Down

0 comments on commit df9258e

Please sign in to comment.