diff options
author | Gergő Tisza <gtisza@wikimedia.org> | 2016-10-05 01:16:56 +0000 |
---|---|---|
committer | Aaron Schulz <aschulz@wikimedia.org> | 2016-10-05 02:55:45 +0000 |
commit | d304f5e3947b969a7dce87cd5336e61d9b683206 (patch) | |
tree | d39ead2104dc880430a8fb09db7529c267aabbf4 /includes/jobqueue/Job.php | |
parent | ce4cb4849527815ff743d682bbb30e37a07e63be (diff) | |
download | mediawikicore-d304f5e3947b969a7dce87cd5336e61d9b683206.tar.gz mediawikicore-d304f5e3947b969a7dce87cd5336e61d9b683206.zip |
Pass Job success status to teardown callbacks
Change-Id: Icf2e03efcfd9232fe4ead776096b61cef1c06141
Diffstat (limited to 'includes/jobqueue/Job.php')
-rw-r--r-- | includes/jobqueue/Job.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/includes/jobqueue/Job.php b/includes/jobqueue/Job.php index bbd0ddb5f8df..f814ceeb1b8b 100644 --- a/includes/jobqueue/Job.php +++ b/includes/jobqueue/Job.php @@ -301,7 +301,9 @@ abstract class Job implements IJobSpecification { } /** - * @param callable $callback + * @param callable $callback A function with one parameter, the success status, which will be + * false if the job failed or it succeeded but the DB changes could not be committed or + * any deferred updates threw an exception. (This parameter was added in 1.28.) * @since 1.27 */ protected function addTeardownCallback( $callback ) { @@ -310,12 +312,12 @@ abstract class Job implements IJobSpecification { /** * Do any final cleanup after run(), deferred updates, and all DB commits happen - * + * @param bool $status Whether the job, its deferred updates, and DB commit all succeeded * @since 1.27 */ - public function teardown() { + public function teardown( $status ) { foreach ( $this->teardownCallbacks as $callback ) { - call_user_func( $callback ); + call_user_func( $callback, $status ); } } |