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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maven-proxy",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Maven proxy with cache, HTTPS MITM for selected domains, and local repo publishing",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -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) {