Comparing version 4.0.10 to 4.0.11
{ | ||
"name": "0x", | ||
"version": "4.0.10", | ||
"version": "4.0.11", | ||
"description": "🔥 single-command flamegraph profiling 🔥", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
'use strict' | ||
const fs = require('fs') | ||
@@ -10,2 +11,5 @@ const path = require('path') | ||
const v8LogToTicks = require('../lib/v8-log-to-ticks') | ||
const { promisify } = require('util') | ||
const rename = promisify(fs.rename) | ||
const sleep = promisify(setTimeout) | ||
@@ -73,3 +77,3 @@ const { | ||
const isolateLogPath = path.join(folder, isolateLog) | ||
fs.renameSync(path.join(args.workingDir, isolateLog), isolateLogPath) | ||
await renameSafe(path.join(args.workingDir, isolateLog), isolateLogPath) | ||
return { | ||
@@ -83,2 +87,14 @@ ticks: await v8LogToTicks(isolateLogPath), | ||
async function renameSafe (from, to, tries = 0) { | ||
try { | ||
await rename(from, to) | ||
} catch (e) { | ||
if (tries > 5) { | ||
throw e | ||
} | ||
await sleep(1000) | ||
await renameSafe(from, to, tries++) | ||
} | ||
} | ||
function collectInliningInfo (sp) { | ||
@@ -127,2 +143,2 @@ var root | ||
return inlined | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83353
1609