DEV: save missing s3 uploads count in redis

DEV: save missing s3 uploads count in redis

diff --git a/lib/s3_inventory.rb b/lib/s3_inventory.rb
index e0c8aed..e43ab37 100644
--- a/lib/s3_inventory.rb
+++ b/lib/s3_inventory.rb
@@ -58,6 +58,8 @@ class S3Inventory
           missing_uploads = uploads.joins("LEFT JOIN #{table_name} ON #{table_name}.etag = #{model.table_name}.etag").where("#{table_name}.etag is NULL")
           if (missing_count = missing_uploads.count) > 0
+            $redis.set("missing_s3_#{model.table_name}", missing_count)
   , :url).find_each do |upload|
               log upload.url
diff --git a/spec/components/s3_inventory_spec.rb b/spec/components/s3_inventory_spec.rb
index 3f81fb6..bed0345 100644
--- a/spec/components/s3_inventory_spec.rb
+++ b/spec/components/s3_inventory_spec.rb
@@ -75,6 +75,7 @@ describe "S3Inventory" do
     expect(output).to eq("#{upload.url}\n1 of 4 uploads are missing\n")
+    expect($redis.get("missing_s3_uploads")).to eq("1")
   it "should backfill etags to uploads table correctly" do

GitHub sha: df6ef856

We should probably have a helper method here and also set it with some sort of expiry, even 1 month is fine.


It’s already done as per commit