File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ struct CacheImpl : Cache
54
54
const Key & key,
55
55
const Attrs & value) override
56
56
{
57
+ if (disabled ()) return ;
58
+
57
59
_state.lock ()->upsert .use ()
58
60
(key.first )
59
61
(attrsToJSON (key.second ).dump ())
@@ -81,9 +83,20 @@ struct CacheImpl : Cache
81
83
return {};
82
84
}
83
85
86
+ pid_t originalPid = getpid();
87
+
88
+ bool disabled ()
89
+ {
90
+ // FIXME: Temporary hack to disable the cache in
91
+ // builtin:fetch-tree builders.
92
+ return getpid () != originalPid;
93
+ }
94
+
84
95
std::optional<Result> lookupExpired (
85
96
const Key & key) override
86
97
{
98
+ if (disabled ()) return {};
99
+
87
100
auto state (_state.lock ());
88
101
89
102
auto keyJSON = attrsToJSON (key.second ).dump ();
@@ -111,6 +124,8 @@ struct CacheImpl : Cache
111
124
Attrs value,
112
125
const StorePath & storePath) override
113
126
{
127
+ if (disabled ()) return ;
128
+
114
129
/* Add the store prefix to the cache key to handle multiple
115
130
store prefixes. */
116
131
key.second .insert_or_assign (" store" , store.storeDir );
You can’t perform that action at this time.
0 commit comments