From 8912aef33fa950ec5cbab648401f00dc1537252c Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 21 Oct 2014 15:07:39 -0700 Subject: [PATCH] Expose job metadata in showJobs and the jobs log * This means that redis job UUIDs now show up in these places Change-Id: Icea168de7e1590bfe275646bc2ccbb7151f032ae --- includes/jobqueue/Job.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) 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; -- 2.20.1