@@ -29,15 +29,29 @@ export function createLruCache ({ size }) {
29
29
}
30
30
31
31
export function getByProcessWith ( { cache = internalCache } ) {
32
- return async ( processId ) => {
32
+ return async ( process ) => {
33
33
if ( ! internalSize ) return
34
- return cache . get ( processId )
34
+ return cache . get ( process )
35
35
}
36
36
}
37
37
38
38
export function setByProcessWith ( { cache = internalCache } ) {
39
- return async ( processId , processData ) => {
39
+ return async ( process , { url , address } , ttl ) => {
40
40
if ( ! internalSize ) return
41
- return cache . set ( processId , processData )
41
+ return cache . set ( process , { url, address } , { ttl } )
42
+ }
43
+ }
44
+
45
+ export function getByOwnerWith ( { cache = internalCache } ) {
46
+ return async ( owner ) => {
47
+ if ( ! internalSize ) return
48
+ return cache . get ( owner )
49
+ }
50
+ }
51
+
52
+ export function setByOwnerWith ( { cache = internalCache } ) {
53
+ return async ( owner , url , ttl ) => {
54
+ if ( ! internalSize ) return
55
+ return cache . set ( owner , { url, address : owner } , { ttl } )
42
56
}
43
57
}
0 commit comments