Skip to content

Commit

Permalink
修改命名规则, 遵循ps-4
Browse files Browse the repository at this point in the history
  • Loading branch information
feeloho committed Nov 2, 2018
1 parent 83f8f5c commit a765780
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"autoload": {
"psr-4": {
"feeloho\\MultiServerEvent\\": "src/"
"Feeloho\\MultiServerEvent\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"feeloho\\MultiServerEvent\\": "tests"
"Feeloho\\MultiServerEvent\\": "tests"
}
},
"require-dev": {
Expand Down
8 changes: 4 additions & 4 deletions src/Scheduling/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function skipMultiserver()
{
$this->eventLost = true;
try {
Cache::forever($this->key, Carbon::now());
$this->cache->forever($this->key, Carbon::now());
} catch (\Exception $e) {
$this->eventLost = false;
}
Expand Down Expand Up @@ -92,8 +92,8 @@ public function ensureFinishedMultiServer($minutes)
*/
public function ensureFinished($minutes)
{
if (Cache::get($this->key) &&
Cache::get($this->key) < Carbon::now()->subMinutes($minutes) &&
if ($this->cache->has($this->key) &&
$this->cache->get($this->key) < Carbon::now()->subMinutes($minutes) &&
$this->clearMultiserver()
) {
event(new EnsureCleanUpExecuted($this->command));
Expand All @@ -108,7 +108,7 @@ public function ensureFinished($minutes)
public function clearMultiserver()
{
if ($this->key) {
Cache::delete($this->key);
$this->cache->forget($this->key);
}
return true;
}
Expand Down

0 comments on commit a765780

Please sign in to comment.