Comments (2)
Good day. I have next case:
- Some external paid API with limited requests per time
- The parts of the methods from this API free for use (like version, data-version, balance etc)
- I cached paid results from this API using cache-db (to be independent from reboot of production machine). It's ok
- Today i start using
TagDependency
with tag equals $api->dataVersion() and i have fail with $value['data'] is resource instead of string and it cannot be unserialized. But it's still works without dependencyDB - PostgreSql 14 with bytea data type
Please could you write the code that fails to reproduce the problem,
from cache-db.
Good day. I have next case:
- Some external paid API with limited requests per time
- The parts of the methods from this API free for use (like version, data-version, balance etc)
- I cached paid results from this API using cache-db (to be independent from reboot of production machine). It's ok
- Today i start using
TagDependency
with tag equals $api->dataVersion() and i have fail with $value['data'] is resource instead of string and it cannot be unserialized. But it's still works without dependencyDB - PostgreSql 14 with bytea data type
Please could you write the code that fails to reproduce the problem,
public function __call($name, $arguments)
{
if (!is_callable([$this->client, $name])) {
throw new BadMethodCallException();
}
$version = $this->getVersion('factor'); //wiil return string like "8.0 (90780)" or null if API has some error
$key = array_merge([__CLASS__, $name], $arguments);
if ($version) {
$ttl = null;
$dependency = new TagDependency($version);
} else {
$ttl = 86400;
$dependency = null;
}
return $this->cache->getOrSet($key, function() use ($name, $arguments) {
return $this->client->{$name}(...$arguments);
}, $ttl, $dependency);
}
from cache-db.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cache-db.