Skip to content

Commit

Permalink
Merge pull request #144 from Expensify/amechler-update-priority
Browse files Browse the repository at this point in the history
Update Jobs to accept new `priority` parameter
  • Loading branch information
iwiznia committed Feb 5, 2020
2 parents fbec82d + 40b0087 commit d646474
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "expensify/Bedrock-PHP",
"description": "Bedrock PHP Library",
"type": "library",
"version": "1.8.3",
"version": "1.8.4",
"authors": [
{
"name": "Expensify",
Expand Down
10 changes: 6 additions & 4 deletions src/Jobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,14 @@ public function getJobs(string $name, int $numResults, array $params = []): arra
/**
* Updates the data associated with a job.
*
* @param int $jobID
* @param array $data
* @param string $repeat (optional) see https://github.com/Expensify/Bedrock/blob/master/plugins/Jobs.md#repeat-syntax
* @param int $jobID
* @param array $data
* @param string $repeat (optional) see https://github.com/Expensify/Bedrock/blob/master/plugins/Jobs.md#repeat-syntax
* @param int|null $priority (optional) The new priority of the job
*
* @return array
*/
public function updateJob($jobID, $data, $repeat = null)
public function updateJob($jobID, $data, $repeat = null, ?int $priority = null)
{
$commitCounts = Client::getCommitCounts();
return $this->call(
Expand All @@ -279,6 +280,7 @@ public function updateJob($jobID, $data, $repeat = null)
"jobID" => $jobID,
"data" => array_merge($data ?? [], count($commitCounts) ? ['_commitCounts' => $commitCounts] : []),
"repeat" => $repeat,
"jobPriority" => $priority,
"idempotent" => true,
]
);
Expand Down

0 comments on commit d646474

Please sign in to comment.