()
| 73 | { name: PLUGIN_NAME, stage: Cache.STAGE_DISK }, |
| 74 | (identifier, etag, gotHandlers) => { |
| 75 | const restore = () => |
| 76 | strategy.restore(identifier, etag).then((cacheEntry) => { |
| 77 | if (cacheEntry === undefined) { |
| 78 | gotHandlers.push((result, callback) => { |
| 79 | if (result !== undefined) { |
| 80 | pendingIdleTasks.set(identifier, () => |
| 81 | strategy.store(identifier, etag, result) |
| 82 | ); |
| 83 | } |
| 84 | callback(); |
| 85 | }); |
| 86 | } else { |
| 87 | return cacheEntry; |
| 88 | } |
| 89 | }); |
| 90 | const pendingTask = pendingIdleTasks.get(identifier); |
| 91 | if (pendingTask !== undefined) { |
| 92 | pendingIdleTasks.delete(identifier); |
no test coverage detected