12use UnexpectedValueException;
13use Wikimedia\Timestamp\TimestampFormat as TS;
59 'requestId' => Telemetry::getInstance()->getRequestId(),
76 $page = PageReferenceValue::localReference(
NS_SPECIAL,
'Badtitle/' . __CLASS__ );
84 foreach (
$params as $p => $v ) {
85 if ( is_array( $v ) ) {
87 } elseif ( !is_scalar( $v ) && $v !==
null ) {
88 throw new UnexpectedValueException(
"Job parameter $p is not JSON serializable." );
105 return isset( $this->params[
'jobReleaseTimestamp'] )
112 return !empty( $this->opts[
'removeDuplicates'] );
121 if ( is_array( $info[
'params'] ) ) {
123 unset( $info[
'params'][
'rootJobSignature'] );
124 unset( $info[
'params'][
'rootJobTimestamp'] );
126 unset( $info[
'params'][
'jobReleaseTimestamp'] );
128 unset( $info[
'params'][
'requestId'] );
129 if ( isset( $this->opts[
'removeDuplicatesIgnoreParams'] ) ) {
130 foreach ( $this->opts[
'removeDuplicatesIgnoreParams'] as $field ) {
131 unset( $info[
'params'][$field] );
142 'rootJobSignature' => $this->params[
'rootJobSignature'] ??
null,
143 'rootJobTimestamp' => $this->params[
'rootJobTimestamp'] ?? null
149 return isset( $this->params[
'rootJobSignature'] )
150 && isset( $this->params[
'rootJobTimestamp'] );
155 return $this->
hasRootJobParams() && !empty( $this->params[
'rootJobIsSelf'] );
168 PageReferenceValue::localReference( $map[
'title'][
'ns'], $map[
'title'][
'key'] )
174class_alias( JobSpecification::class,
'JobSpecification' );
wfTimestampOrNull( $outputtype=TS::UNIX, $ts=null)
Return a formatted timestamp, or null if input is null.