Index: trunk/phase3/includes/Wiki.php |
— | — | @@ -335,14 +335,16 @@ |
336 | 336 | } |
337 | 337 | |
338 | 338 | /** |
339 | | - * Cleaning up by doing deferred updates, calling LBFactory and doing the output |
| 339 | + * Cleaning up request by doing: |
| 340 | + ** deferred updates, DB transaction, and the output |
340 | 341 | * |
341 | 342 | * @param $deferredUpdates array of updates to do |
342 | 343 | * @param $output OutputPage |
343 | 344 | */ |
344 | 345 | function finalCleanup( &$deferredUpdates, &$output ) { |
345 | 346 | wfProfileIn( __METHOD__ ); |
346 | | - # Now commit any transactions, so that unreported errors after output() don't roll back the whole thing |
| 347 | + # Now commit any transactions, so that unreported errors after |
| 348 | + # output() don't roll back the whole DB transaction |
347 | 349 | $factory = wfGetLBFactory(); |
348 | 350 | $factory->commitMasterChanges(); |
349 | 351 | # Output everything! |
— | — | @@ -350,8 +352,6 @@ |
351 | 353 | # Do any deferred jobs |
352 | 354 | $this->doUpdates( $deferredUpdates ); |
353 | 355 | $this->doJobs(); |
354 | | - # Commit and close up! |
355 | | - $factory->shutdown(); |
356 | 356 | wfProfileOut( __METHOD__ ); |
357 | 357 | } |
358 | 358 | |
— | — | @@ -422,6 +422,10 @@ |
423 | 423 | */ |
424 | 424 | function restInPeace() { |
425 | 425 | wfLogProfilingData(); |
| 426 | + # Commit and close up! |
| 427 | + $factory = wfGetLBFactory(); |
| 428 | + $factory->commitMasterChanges(); |
| 429 | + $factory->shutdown(); |
426 | 430 | wfDebug( "Request ended normally\n" ); |
427 | 431 | } |
428 | 432 | |