@@ -23,6 +23,10 @@ pub struct RestoreCommand {
23
23
#[ clap( long) ]
24
24
json : bool ,
25
25
26
+ /// Disable immutables digest cache.
27
+ #[ clap( long) ]
28
+ disable_digest_cache : bool ,
29
+
26
30
/// Digest of the snapshot to download. Use the `list` command to get that information.
27
31
digest : String ,
28
32
}
@@ -51,7 +55,7 @@ impl RestoreCommand {
51
55
52
56
let digester = Box :: new ( CardanoImmutableDigester :: new (
53
57
Path :: new ( & unpacked_path) . into ( ) ,
54
- build_digester_cache_provider ( ) ?,
58
+ build_digester_cache_provider ( self . disable_digest_cache ) ?,
55
59
slog_scope:: logger ( ) ,
56
60
) ) ;
57
61
let output = runtime
@@ -82,10 +86,15 @@ docker run -v cardano-node-ipc:/ipc -v cardano-node-data:/data --mount type=bind
82
86
}
83
87
84
88
fn build_digester_cache_provider (
89
+ disable_digest_cache : bool ,
85
90
) -> Result < Arc < dyn ImmutableFileDigestCacheProvider > , Box < dyn Error > > {
91
+ if disable_digest_cache {
92
+ return Ok ( Arc :: new ( MemoryImmutableFileDigestCacheProvider :: default ( ) ) ) ;
93
+ }
94
+
86
95
match ProjectDirs :: from ( "io" , "iohk" , "mithril" ) {
87
96
None => {
88
- warn ! ( "Could not get cache directory for immutables digests, fallback to In Memory cache provider " ) ;
97
+ warn ! ( "Could not get cache directory for immutables digests" ) ;
89
98
Ok ( Arc :: new ( MemoryImmutableFileDigestCacheProvider :: default ( ) ) )
90
99
}
91
100
Some ( project_dirs) => {
0 commit comments