File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
turbopack/crates/turbo-persistence/src Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1152,12 +1152,22 @@ impl<S: ParallelScheduler> TurboPersistence<S> {
1152
1152
1153
1153
/// Get a value from the database. Returns None if the key is not found. The returned value
1154
1154
/// might hold onto a block of the database and it should not be hold long-term.
1155
- pub fn get < K : QueryKey > ( & self , family : usize , key : & K ) -> Result < Option < ArcSlice < u8 > > > {
1155
+ pub fn get < K : QueryKey + Sync > ( & self , family : usize , key : & K ) -> Result < Option < ArcSlice < u8 > > > {
1156
1156
let hash = hash_key ( key) ;
1157
+ self . parallel_scheduler
1158
+ . block_in_place ( || self . get_inner ( family as u32 , hash, key) )
1159
+ }
1160
+
1161
+ fn get_inner < K : QueryKey > (
1162
+ & self ,
1163
+ family : u32 ,
1164
+ hash : u64 ,
1165
+ key : & K ,
1166
+ ) -> Result < Option < ArcSlice < u8 > > > {
1157
1167
let inner = self . inner . read ( ) ;
1158
1168
for meta in inner. meta_files . iter ( ) . rev ( ) {
1159
1169
match meta. lookup (
1160
- family as u32 ,
1170
+ family,
1161
1171
hash,
1162
1172
key,
1163
1173
& self . amqf_cache ,
You can’t perform that action at this time.
0 commit comments