// This avoids having long running scripts just OOM and lose all the updates.
$maintenance->setAgentAndTriggers();
+$maintenance->validateParamsAndArgs();
+
// Do the work
-$maintenance->execute();
+$success = $maintenance->execute();
// Potentially debug globals
$maintenance->globals();
$lbFactory->commitMasterChanges( 'doMaintenance' );
$lbFactory->shutdown( $lbFactory::SHUTDOWN_NO_CHRONPROT );
}
+
+// Exit with an error status if execute() returned false
+if ( $success === false ) {
+ exit( 1 );
+}