File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
lib/oso-core/oso_core/cache
warehouse/oso_dagster/assets/sqlmesh Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -26,10 +26,12 @@ def with_no_expiration(cls) -> t.Self:
2626 return cls (ttl_seconds = 0 )
2727
2828 @classmethod
29- def with_no_expiration_if (cls , condition : bool ) -> t .Self :
29+ def with_no_expiration_if (
30+ cls , condition : bool , default_ttl_seconds : int = 900
31+ ) -> t .Self :
3032 if condition :
3133 return cls .with_no_expiration ()
32- return cls ()
34+ return cls (ttl_seconds = default_ttl_seconds )
3335
3436
3537class CacheOptions (BaseModel ):
Original file line number Diff line number Diff line change @@ -126,7 +126,8 @@ def sqlmesh_factory(
126126 sqlmesh_gateway = global_config .sqlmesh_gateway ,
127127 ),
128128 cache_metadata_options = CacheMetadataOptions .with_no_expiration_if (
129- global_config .run_mode == "build" and global_config .in_deployed_container
129+ global_config .run_mode == "build" and global_config .in_deployed_container ,
130+ default_ttl_seconds = global_config .asset_cache_default_ttl_seconds ,
130131 ),
131132 )
132133 def cacheable_sqlmesh_multi_asset_options (
You can’t perform that action at this time.
0 commit comments