Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] Cache::lock support for the database cache driver #32639

Merged
merged 7 commits into from
May 4, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply fixes from StyleCI (#32640)
taylorotwell authored May 1, 2020
commit 1f8c8bdd76d45a5682f2bd23f6040eeeb3acb8ca
8 changes: 4 additions & 4 deletions src/Illuminate/Cache/DatabaseLock.php
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ public function acquire()
$this->connection->table($this->table)->insert([
'id' => $this->name,
'owner' => $this->owner,
'expires_at' => $this->expiresAt()
'expires_at' => $this->expiresAt(),
]);

$acquired = true;
@@ -71,9 +71,9 @@ public function acquire()
->where(function ($query) {
return $query->where('owner', $this->owner)->orWhere('expires_at', '<=', time());
})->update([
'owner' => $this->owner,
'expires_at' => $this->expiresAt()
]);
'owner' => $this->owner,
'expires_at' => $this->expiresAt(),
]);

$acquired = $updated >= 1;
}