Discovered that the rails cache will store nil results on occasions where the Getty api is down. For example say the Getty api is down when you are querying the tgn7000874. Geomash will return an empty value due to the the Getty api throwing a 503. However when the site comes back up and you query that value again in geomash it will still return nil. It appears we should set the skip_nils: true option in the Rails.cache.fetch(...) calls in the GeomashController like so.
Rails.cache.fetch("bpldc:geomash/tgn/#{params[:id]}", skip_nils: true) do
...
Discovered that the rails cache will store
nil
results on occasions where the Getty api is down. For example say the Getty api is down when you are querying thetgn
7000874
.Geomash
will return an empty value due to the the Getty api throwing a 503. However when the site comes back up and you query that value again ingeomash
it will still returnnil
. It appears we should set theskip_nils: true
option in theRails.cache.fetch(...)
calls in theGeomashController
like so.