Committer: gariev
LJSUP-6721: Clean Caches cronjob failsU trunk/cgi-bin/LJ/API/Twitter.pm
Modified: trunk/cgi-bin/LJ/API/Twitter.pm =================================================================== --- trunk/cgi-bin/LJ/API/Twitter.pm 2010-09-02 10:48:31 UTC (rev 9459) +++ trunk/cgi-bin/LJ/API/Twitter.pm 2010-09-02 15:29:42 UTC (rev 9460) @@ -309,6 +309,14 @@ # we store them for a day my $time_stale = time - 86400; + ## + ## This is a hack to work around the following error: + ## DBD::mysql::db do failed: MySQL server has gone away + ## The real problem is that LJ::get_db_writer() doesn't check + ## cached connection handle before returning it. + ## + LJ::start_request(); + my $dbh = LJ::get_db_writer(); $dbh->{'RaiseError'} = 1; $dbh->do(