From: Aaron Schulz Date: Tue, 21 Oct 2014 22:07:39 +0000 (-0700) Subject: Expose job metadata in showJobs and the jobs log X-Git-Tag: 1.31.0-rc.0~13517 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=8912aef33fa950ec5cbab648401f00dc1537252c;p=lhc%2Fweb%2Fwiklou.git Expose job metadata in showJobs and the jobs log * This means that redis job UUIDs now show up in these places Change-Id: Icea168de7e1590bfe275646bc2ccbb7151f032ae --- diff --git a/includes/jobqueue/Job.php b/includes/jobqueue/Job.php index d01a279e57..56fd1c6d0b 100644 --- a/includes/jobqueue/Job.php +++ b/includes/jobqueue/Job.php @@ -277,13 +277,22 @@ abstract class Job implements IJobSpecification { } } - if ( is_object( $this->title ) ) { - $s = "{$this->command} {$this->title->getPrefixedDBkey()}"; - if ( $paramString !== '' ) { - $s .= " $paramString"; + $metaString = ''; + foreach ( $this->metadata as $key => $value ) { + if ( is_scalar( $value ) && mb_strlen( $value ) < 1024 ) { + $metaString .= ( $metaString ? ",$key=$value" : "$key=$value" ); } - } else { - $s = "{$this->command} $paramString"; + } + + $s = $this->command; + if ( is_object( $this->title ) ) { + $s .= " {$this->title->getPrefixedDBkey()}"; + } + if ( $paramString != '' ) { + $s .= " $paramString"; + } + if ( $metaString != '' ) { + $s .= " ($metaString)"; } return $s;