mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-24 03:54:21 +01:00
NUT-19: Cached Requests and Responses (#624)
* fast-api-cache setup * testing the cache * fix * still not working * asynccontextmanager * move test * use redis & custom caching setup (like CDK) * make format * poetry lock * fix format string + log when a cached response is found * log when a cahced response is found * fix tests * poetry lock * try tests on github * use docker compose * maybe we dont need docker * fix types * create_task instead of run * how about we start postgres * mint features * format * remove deprecated setex call * use global expiry for all cached routes * refactor feature map and set default to 1 week * refactor feature construction * Cache NUT-19 --------- Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
This commit is contained in:
@@ -231,6 +231,12 @@ class CoreLightningRestFundingSource(MintSettings):
|
||||
mint_corelightning_rest_cert: Optional[str] = Field(default=None)
|
||||
|
||||
|
||||
class MintRedisCache(MintSettings):
|
||||
mint_redis_cache_enabled: bool = Field(default=False)
|
||||
mint_redis_cache_url: Optional[str] = Field(default=None)
|
||||
mint_redis_cache_ttl: Optional[int] = Field(default=60 * 60 * 24 * 7) # 1 week
|
||||
|
||||
|
||||
class Settings(
|
||||
EnvSettings,
|
||||
LndRPCFundingSource,
|
||||
@@ -240,6 +246,7 @@ class Settings(
|
||||
FakeWalletSettings,
|
||||
MintLimits,
|
||||
MintBackends,
|
||||
MintRedisCache,
|
||||
MintDeprecationFlags,
|
||||
MintSettings,
|
||||
MintInformation,
|
||||
|
||||
Reference in New Issue
Block a user