Fork me on GitHub

if an ion fetches an ssm parameter as in the event-example:

(def get-params
  (memoize #(,,, (ion/get-params ,,,))))
when can you expect that to get recomputed? e.g. after next deployment, after next upgrade, never, etc.?


@nolan If you've memoized that function like that it'll update each time the process is cycled so an ion deploy will work to refresh. ion/get-params is just a wrapper around if you want more details Although it might be a better idea just to write your own version. Be careful about exceeding 10 http://p.ararameters per deploy group, your app might explode if you don't explicitly work around the 10 results limit in this API call, as last I remember ion/get-params does not implement the logic to keep calling next-token until all params are fetched.

wizard 4
πŸ‘ 4
πŸ™ 4
clj 4
🀝 4
datomic 4

ah! really appreciate the input @eagonmeng. affirms my suspicions (and hopes, desires, etc. πŸ™), and makes a lot of sense. also appreciate the additional info re: parameter limit, wont be relevant here, but super good to know.

πŸ‘Œ 4

as a slightly tangential follow-up, does memoizing the call to ion/get-env make any material difference? or is that an in-process access anyway (only really worried about production, if that matters)?


Query question: I have an entity called Interaction with an attribute called :devices which is of cardinality many. Those devices are eids. Given a device eid, I'd like to check to see if that device eid appears in an Interaction's :devices and then return all the other device eids. Here's what I have so far:

'[:find ?devices
  :in $ ?dev-eid
  [?interaction :devices ?dev-eid]
  [?interaction :devices ?devices]
However the problem is that my original ?dev-eid is also inside ?devices . I could filter it out after the query, but I feel like it would be better practice to include that filtering in the query (correct me if I'm wrong on that). Additional info: there are only ever 2 eids in any :devices . How can I remove ?dev-eid from ?devices inside my query? Something like "grab all ?devices which are not equal to ?dev-eid ".



[(!= ?devices ?dev-eid)]


Perfect thank you @U09R86PA4! One more (I think) simple thing. I end up only getting a single ?device when I do this. However if I return ?devices ?interaction I end up getting the 4 that I expect (but they are each paired with the ?interaction eid I don't want). It seems like the query just grabs the first one and returns it. How can I have it grab them all?


are the four you expect the same?


query normally returns sets, so if the same device appears 4 times it won’t matter, you will get one device


you can either include :find ?interaction to get the devices per interaction, or use :with ?interaction to include it for the set but then have it removed before returning. queryies with :`with` do not return sets


You were right! The same device appeared multiple times. The data model was slightly different than I expected. I'm getting exactly what I want now =]

Ben Hammond22:03:13

Hi. I'm running datomic-pro-0.9.5697 local transactor and then datomic.peer-server and then datomic.client.api/connect to make the actual connection. It's been working fine for ages; but I've just started to see

Reflection warning, cognitect/hmac_authn.clj:80:12 - call to static method encodeHex on org.apache.commons.codec.binary.Hex can't be resolved (argument types: unknown, java.lang.Boolean).
Reflection warning, cognitect/hmac_authn.clj:80:3 - call to java.lang.String ctor can't be resolved.
warnings and now
Caused by: clojure.lang.ExceptionInfo: No name matching localhost found
{:cognitect.anomalies/category :cognitect.anomalies/fault, :cognitect.anomalies/message "No name matching localhost found", :cognitect.http-client/throwable #error {
 :cause "No name matching localhost found"
 [{:type .ssl.SSLHandshakeException
   :message "No name matching localhost found"
   :at [ createSSLException "" 128]}
   :message "No name matching localhost found"
   :at [ matchDNS "" 225]}]
 [[ matchDNS "" 225]
  [ match "" 98]
  [ checkIdentity "" 459]
 at datomic.client.api.async$ares.invokeStatic (async.clj:56)
    datomic.client.api.async$ares.invoke (async.clj:52)
    datomic.client.api.sync.Client.connect (sync.clj:71)
    datomic.client.api$connect.invokeStatic (api.clj:118)
    datomic.client.api$connect.invoke (api.clj:105)
errors I'm not aware of changing anything; the SSLHandshakeException makes me wonder if some certificate has expired. I don't see any errors reported on the transactor log or in the peer server console

Ben Hammond23:03:16

Hmmm, naively adding

:validate-hostnames false
didn't seem to help

Ben Hammond23:03:26

haven't tried updating datomic binaries though

Ben Hammond23:03:42

just for reference, I am trying this

  (datomic.client.api/client {:server-type :peer-server,
                              :access-key "myaccesskey",
                              :secret "mysecret",
                              :endpoint "localhost:8998",
                              :validate-hostnames false})
  {:db-name "xiangqi"
   :validate-hostnames false}
and I get
Execution error (ExceptionInfo) at datomic.client.api.async/ares (async.clj:56).
No name matching localhost found

Ben Hammond23:03:31

updating from

com.datomic/client-pro {:mvn/version "0.8.28"}
com.datomic/client-pro {:mvn/version "0.9.43"}
seems to have done the trick

Ben Hammond23:03:12

transactor/peer server did not need upgrading; just the client