Skip to content

Instantly share code, notes, and snippets.

@Casual3498
Created May 8, 2018 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Casual3498/36becf26d8ec6c3ae312fe6b8899360e to your computer and use it in GitHub Desktop.
Save Casual3498/36becf26d8ec6c3ae312fe6b8899360e to your computer and use it in GitHub Desktop.
delete cache and fill transactions
del_keys = $redis.keys.select { |el| /\ACryptocompareClient:(BTC|ETH):USD:(\d{10})\z/.match(el).present?&&/\ACryptocompareClient:(BTC|ETH):USD:(\d{10})\z/.match(el)[2].to_i >= DateTime.parse('18-04-2018 00:00').to_i }
del_keys.each { |key| $redis.del(key) }
EthTransaction.all.each { |tr| tr.set_usd_amount }
BtcTransaction.all.each { |tr| tr.set_usd_amount }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment