wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[ljcom] r11781: LJSUP-11940: Implement the removal of im...

Committer: wisest-owl
LJSUP-11940: Implement the removal of images from cdn, when they are removed or become private

U   trunk/cgi-bin/LJ/Hooks/SUP.pm
Modified: trunk/cgi-bin/LJ/Hooks/SUP.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/SUP.pm	2012-04-24 13:57:07 UTC (rev 11780)
+++ trunk/cgi-bin/LJ/Hooks/SUP.pm	2012-04-24 14:03:45 UTC (rev 11781)
@@ -6,6 +6,7 @@
 use LJ::S2Theme;
 use LJ::HomepageItems;
 use LJ::Request;
+use LJ::CDNTools;
 use Encode();
 use GTop;
 
@@ -344,6 +345,8 @@
 
     $LJ::TIME_START_REQUEST = time;
 
+    @LJ::PICS_URLS_DELETE_FROM_CDN = ();
+
     return;
 });
 
@@ -365,6 +368,17 @@
         $ext = "30";
     }
 
+    ## Purging CDN for necessary images
+    if (@LJ::PICS_URLS_DELETE_FROM_CDN && $LJ::PICS_IMAGES_USE_CDN) {
+        my $sclient = LJ::theschwartz();
+        $sclient->insert( TheSchwartz::Job->new(
+            'funcname' => 'LJ::Worker::FotkiPurgeCDN',
+            'arg'      => {
+                'urls' => \@LJ::PICS_URLS_DELETE_FROM_CDN,
+            },
+        ) );
+    }
+
     LJ::run_hook ("update_counter", {
         counter => "request_duration_$ext",
     });

Tags: ljcom, pm, wisest-owl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments