feat(counter): add Mozo::Counter.provision! to seed Redis from CouchDB

- Reads Order.by_supplier_id_and_state view (reduce, grouped)
- Sets Redis keys: supplier_counter:<id>:orders_placed / orders_in_process
- Creates design doc if missing (from drb_counter/couchdb_design.yml)
- Rake task: rails counters:provision
- Also invokable directly: rails runner 'Mozo::Counter.provision!'
This commit is contained in:
BenClaw
2026-05-17 22:02:56 +02:00
parent 686dc65b9c
commit eef3d17431
2 changed files with 57 additions and 0 deletions
+5
View File
@@ -2,4 +2,9 @@ namespace :counters do
task reset: :environment do
Supplier.reset_counters!
end
desc 'Provision Redis counters from CouchDB aggregated data'
task provision: :environment do
Mozo::Counter.provision!
end
end