* Returns promise to the cached content. * @param {string} identifier unique name for the resource * @param {Etag | null} etag etag of the resource * @returns {Promise<Data>} promise to the cached content
(identifier, etag)
| 1409 | * @returns {Promise<Data>} promise to the cached content |
| 1410 | */ |
| 1411 | restore(identifier, etag) { |
| 1412 | return this._getPack() |
| 1413 | .then((pack) => |
| 1414 | pack.get(identifier, etag === null ? null : etag.toString()) |
| 1415 | ) |
| 1416 | .catch((err) => { |
| 1417 | if (err && err.code !== "ENOENT") { |
| 1418 | this.logger.warn( |
| 1419 | `Restoring failed for ${identifier} from pack: ${err}` |
| 1420 | ); |
| 1421 | this.logger.debug(err.stack); |
| 1422 | } |
| 1423 | }); |
| 1424 | } |
| 1425 | |
| 1426 | /** |
| 1427 | * Stores build dependencies. |