~singpolyma/jmp-pay

0a89e153b26b94cd95fec85f29c5a548f57722a8 — Stephen Paul Weber 3 years ago 3589749
Ping healthchecks for each run
1 files changed, 5 insertions(+), 0 deletions(-)

M bin/process_pending_btc_transactions
M bin/process_pending_btc_transactions => bin/process_pending_btc_transactions +5 -0
@@ 2,6 2,7 @@
# frozen_string_literal: true

# Usage: bin/process_pending-btc_transactions '{
#        healthchecks_url = "https://hc-ping.com/...",
#        oxr_app_id = "",
#        required_confirmations = 3,
#        notify_using = {


@@ 30,6 31,8 @@ CONFIG =
	.new(safe: Dhall::Coder::JSON_LIKE + [Symbol, Proc])
	.load(ARGV[0], transform_keys: :to_sym)

Net::HTTP.post_form(URI("#{CONFIG[:healthchecks_url]}/start"), {})

REDIS = Redis.new
ELECTRUM = Electrum.new(**CONFIG[:electrum])



@@ 241,3 244,5 @@ REDIS.hgetall("pending_btc_transactions").each do |(txid, customer_id)|
		end
	end
end

Net::HTTP.post_form(URI(CONFIG[:healthchecks_url].to_s), {})