How to run auto-charge on the Rails console?
Table of contents
Prerequisites
- POWR project already installed and set
- Running the POWR project
- Be familiar with the code that is going to run
lib/tasks/scheduler.rakelib/tasks/scheduler.rake#create_subscription_transactionslib/tasks/scheduler.rake#charge_transactions
Step by Step
- Open a terminal or connect to the sidekiq container from Docker Desktop
docker exec -t powr-sidekiq-1 bash💡 It will open a bash of the powr-sidekiq-1 container.
- Manually open from Docker Desktop
- Run
rake create_subscription_transactions💡 It will create a transaction for the pending pro subscriptions.
- Run
rake charge_transactions💡 Charges the created transactions.
Debugging
If you want to debug locally you should uncomment the following line inside config/environments/development.rb:3.
Also, you can see the failed workers on localhost:3000/sidekiq.