Skip to content

Commit 102d767

Browse files
use Date instead of performance
1 parent bc0e2d9 commit 102d767

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libraries/FileLock.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export async function waitForLock(path: string, options: InternalServerOptions):
1212
retries++;
1313
try {
1414
const stat = await fsPromises.stat(lockPath)
15-
if (performance.now() - stat.mtime.getTime() > mtimeLimit) {
15+
if (Date.now() - stat.mtime.getTime() > mtimeLimit) {
1616
return
1717
} else {
1818
await new Promise(resolve => setTimeout(resolve, options.lockRetryWait))
@@ -52,7 +52,7 @@ export async function lockFile(path: string): Promise<() => Promise<void>> {
5252
if (e.code === 'EEXIST') {
5353
try {
5454
const stat = await fsPromises.stat(lockPath)
55-
if (performance.now() - stat.mtime.getTime() > mtimeLimit) {
55+
if (Date.now() - stat.mtime.getTime() > mtimeLimit) {
5656
return setupMTimeEditor(lockPath)
5757
} else {
5858
throw 'LOCKED'

0 commit comments

Comments
 (0)