Skip to content

Commit

Permalink
Fix update review stop working
Browse files Browse the repository at this point in the history
  • Loading branch information
vtsykun committed Sep 26, 2023
1 parent e810948 commit 2a6b3d5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Integrations/Base/AppIntegrationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,13 @@ protected function pullRequestReview(App $app, array $payload, callable $request
$key = "repo:$name:$iid";

$commentId = null;
if (false === $this->redis->hSetNx($setId, $key, 0)) {
$commentId = $this->redis->hGet($setId, $key);
if (false === $this->redis->hSetNx($setId, $key, '0')) {
$commentId = (int)$this->redis->hGet($setId, $key);
}

if ($commentId === null) {
$review = $request("POST", $diff);
$this->redis->hSet($setId, $key, $review['id']);
$this->redis->hSet($setId, $key, (string)$review['id']);
$this->redis->hSet($setId, "$key:diff", sha1($diff));
return [];
}
Expand Down

0 comments on commit 2a6b3d5

Please sign in to comment.