maven-proxy 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cache/downloader.js +10 -0
package/package.json
CHANGED
package/src/cache/downloader.js
CHANGED
|
@@ -326,6 +326,8 @@ export class Downloader {
|
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
async #downloadAtomic(urlObj, finalPath, requestHeaders) {
|
|
329
|
+
const startedAt = Date.now();
|
|
330
|
+
|
|
329
331
|
await fs.promises.mkdir(path.dirname(finalPath), { recursive: true });
|
|
330
332
|
const tempPath = `${finalPath}.temp`;
|
|
331
333
|
await removeIfExists(tempPath);
|
|
@@ -388,6 +390,14 @@ export class Downloader {
|
|
|
388
390
|
|
|
389
391
|
await verifyFileSize(tempPath, metadata.contentLength);
|
|
390
392
|
await fs.promises.rename(tempPath, finalPath);
|
|
393
|
+
|
|
394
|
+
const finalStats = await fs.promises.stat(finalPath);
|
|
395
|
+
this.logDownload("download succeeded", downloadUrl, {
|
|
396
|
+
host: hostname,
|
|
397
|
+
targetPath: finalPath,
|
|
398
|
+
size: finalStats.size,
|
|
399
|
+
elapsedMs: Date.now() - startedAt,
|
|
400
|
+
});
|
|
391
401
|
} catch (error) {
|
|
392
402
|
if (isLocalFsWriteError(error)) {
|
|
393
403
|
if (!error.statusCode) {
|