holyandrew (holyandrew) wrote in changelog,
holyandrew
holyandrew
changelog

[livejournal] r20944: LJSV-1762: A user has used only 4GB out ...

Committer: akanashin
LJSV-1762: A user has used only 4GB out of 10GB scrapbook space, but is getting 'disk full' error
U   trunk/cgi-bin/LJ/Blob.pm
Modified: trunk/cgi-bin/LJ/Blob.pm
===================================================================
--- trunk/cgi-bin/LJ/Blob.pm	2012-01-20 11:21:20 UTC (rev 20943)
+++ trunk/cgi-bin/LJ/Blob.pm	2012-01-20 11:46:28 UTC (rev 20944)
@@ -133,32 +133,15 @@
     shift @_ unless LJ::isu($_[0]);  # let it be called as class method (LJ::Blob->get_disk_usage($u,...))
     my ($u, $domain) = @_;
     my $dbcr = LJ::get_cluster_reader($u);
-    my $udbh;
     if ($domain) {
-        if ($domain eq 'fotobilder') {
-            eval{$udbh = FB::get_db_writer()};
-            return 0 unless $udbh;
-            my $diskusage_Kb = $udbh->selectrow_array(qq{
-                     SELECT Kibused FROM diskusage
-                     WHERE userid = ?
-                     }, undef, $u->{'userid'});
-            return $diskusage_Kb * 1024;
-        } else {
-            return $dbcr->selectrow_array("SELECT SUM(length) FROM userblob ".
-                                          "WHERE journalid=? AND domain=?", undef,
-                                          $u->{userid}, LJ::get_blob_domainid($domain));
-        }
+        return $dbcr->selectrow_array("SELECT SUM(length) FROM userblob ".
+                                      "WHERE journalid=? AND domain=?", undef,
+                                      $u->{userid}, LJ::get_blob_domainid($domain));
+        
     } else {
-        eval {$udbh = FB::get_db_writer()};
-        my $diskusage_fotobilder_Kb = 0;
-        my $diskusage_without_fotobilder = $dbcr->selectrow_array("SELECT SUM(length) FROM userblob ".
-                                                                  "WHERE journalid=? AND domain<>?", undef, 
-                                                                  $u->{userid}, LJ::get_blob_domainid('fotobilder'));
-        if ($udbh) { $diskusage_fotobilder_Kb = $udbh->selectrow_array(qq{
-                     SELECT Kibused FROM diskusage
-                     WHERE userid = ?
-                     }, undef, $u->{'userid'});}
-        return $diskusage_without_fotobilder+$diskusage_fotobilder_Kb*1024;
+        return $dbcr->selectrow_array("SELECT SUM(length) FROM userblob ".
+                                      "WHERE journalid=? AND domain<>?", undef, 
+                                      $u->{userid}, LJ::get_blob_domainid('fotobilder'));
     }
 }
 

Tags: akanashin, holyandrew, livejournal, pm
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