holyandrew (holyandrew) wrote in changelog,
holyandrew
holyandrew
changelog

[livejournal] r20933: 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-19 09:53:43 UTC (rev 20932)
+++ trunk/cgi-bin/LJ/Blob.pm	2012-01-19 12:01:11 UTC (rev 20933)
@@ -136,6 +136,7 @@
     if ($domain) {
         if ($domain eq 'fotobilder') {
             my $udbh = FB::get_db_writer();
+            return 0 unless $udbh;
             my $diskusage_Kb = $udbh->selectrow_array(qq{
                      SELECT Kibused FROM diskusage
                      WHERE userid = ?
@@ -148,13 +149,14 @@
         }
     } else {
         my $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'));
-        my $diskusage_fotobilder_Kb = $udbh->selectrow_array(qq{
+        if ($udbh) { $diskusage_fotobilder_Kb = $udbh->selectrow_array(qq{
                      SELECT Kibused FROM diskusage
                      WHERE userid = ?
-                     }, undef, $u->{'userid'});
+                     }, undef, $u->{'userid'});}
         return $diskusage_without_fotobilder+$diskusage_fotobilder_Kb*1024;
     }
 }

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