MCPcopy
hub / github.com/webpack/webpack / _readFreshContextTimestamp

Method _readFreshContextTimestamp

lib/FileSystemInfo.js:1686–1695  ·  view source on GitHub ↗

* Reads a context timestamp directly from disk, bypassing any cached * entry. Used by `getContextTimestamp` and the snapshot validity * checks when the cached entry is missing or is an `ExistenceOnlyTimeEntry` * (`{}`) supplied by watchpack — both cases require a fresh read to * obtain the `

(path, callback)

Source from the content-addressed store, hash-verified

1684 * @returns {void}
1685 */
1686 _readFreshContextTimestamp(path, callback) {
1687 this.contextTimestampQueue.add(path, (err, _entry) => {
1688 if (err) return callback(err);
1689 const entry = /** @type {ContextFileSystemInfoEntry | null} */ (_entry);
1690 if (entry === null) return callback(null, null);
1691 const resolved = getResolvedTimestamp(entry);
1692 if (resolved !== undefined) return callback(null, resolved);
1693 this._resolveContextTimestamp(entry, callback);
1694 });
1695 }
1696
1697 /**
1698 * Get unresolved context timestamp. Existence-only cache entries (`{}`)

Callers 3

getContextTimestampMethod · 0.95

Calls 4

getResolvedTimestampFunction · 0.85
callbackFunction · 0.50
addMethod · 0.45

Tested by

no test coverage detected