This commit is contained in:
1 parent
d086b29bcc
commit
a1ac81a73a
29 files changed
+2349
-17899
No files matched your search
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\BookInformation;
|
||||
|
||||
use Cache;
|
||||
|
||||
class CachedService implements BookLookupService {
|
||||
private $service;
|
||||
|
||||
public function __construct($service) {
|
||||
$this->service = $service;
|
||||
}
|
||||
|
||||
public function lookup($isbn) {
|
||||
return Cache::remember('isbn_' . $isbn, 86400, function() use ($isbn) {
|
||||
return $this->service->lookup($isbn);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user