Merge branch 'low-balance-auto-top-up'
* low-balance-auto-top-up:
Some people have exactly 5 who don't need to be told
On low balance, top-up or notify
ExpiringLock helper
Some people have exactly 5 who don't need to be told
On low balance, top-up or notify
On start up, check for users with low balance and NOTIFY about them. LISTEN for
such notifications and process by either sending a low-balance warning message
or else attempting an auto-top-up as configured.
Using NOTIFY/LISTEN because then we can NOTIFY after any INSERT that leaves the
balance too low (using a trigger). Doing the sync on start-up in case we missed
a NOTIFY during any downtime. Using the Redis lock to prevent spamming a
low-balance user in case of many restarts or if they have many small
transactions happen in one day.
ExpiringLock helper
For things we want to do only so often, set up a helper to push expiring keys to
Redis and check for them.
Merge branch 'cancel-timeout'
* cancel-timeout:
Timeout is not a fatal error
When user cancels the command, respond with canceled
Timeout is not a fatal error
If the user does not proceed with a command after N time, we don't hold on to it
forever and time out. We cannot return anything to the user because they
haven't sent us anything, so just ignore it.
When user cancels the command, respond with canceled
If the cancel has not been fully handled in the body of the command, at least
respond with canceled status and do not go to sentry.
Merge branch 'command-object'
* command-object:
ErrorToSend => FinalStanza
Since Command#finish causes an error, a then off the end won't work
Refactor commands to have Command and Command::Execution objects
ErrorToSend => FinalStanza
Since Command#finish causes an error, a then off the end won't work
Merge branch 'statsd-logging'
* statsd-logging:
Use the logger for all gems
Use the logger for all gems
README Notes for Setup
I ran this setup from a semi-clean environment, and there were some
steps I needed to do that weren't captured anywhere.
Fix usage report range
Show things from all of the start of range (today)
Refactor commands to have Command and Command::Execution objects
Brings the common elements of all commands together, and threads the most useful
state (such as ability to reply) through automatically using the new EMPromise
fiber trampoline.
Ask electrum to notify on new BTC addresses
Otherwise we won't know when someone has paid...
Factor out CustomerRepo
Using the Repository pattern to encapsulate the fetch and create operations on
the persistence layer for a domain object. These were not really factories in
the classic sense, but rather "fetch from persisitence layer" methods, and so
they now have a home.