fix: valid way of lock checking
This commit is contained in:
parent
60eaf676f5
commit
02f442ab05
1 changed files with 2 additions and 2 deletions
|
|
@ -128,8 +128,8 @@ const setupSession = async (sessionId) => {
|
||||||
const client = new Client(clientOptions)
|
const client = new Client(clientOptions)
|
||||||
if (releaseBrowserLock) {
|
if (releaseBrowserLock) {
|
||||||
// See https://github.com/puppeteer/puppeteer/issues/4860
|
// See https://github.com/puppeteer/puppeteer/issues/4860
|
||||||
const singletonLockPath = path.join(sessionFolderPath, `session-${sessionId}`, 'SingletonLock')
|
const singletonLockPath = path.resolve(path.join(sessionFolderPath, `session-${sessionId}`, 'SingletonLock'))
|
||||||
const singletonLockExists = await fs.promises.access(singletonLockPath).then(() => true).catch(() => false)
|
const singletonLockExists = await fs.promises.lstat(singletonLockPath).then(() => true).catch(() => false)
|
||||||
if (singletonLockExists) {
|
if (singletonLockExists) {
|
||||||
console.log('Browser lock file exists, removing ', sessionId)
|
console.log('Browser lock file exists, removing ', sessionId)
|
||||||
await fs.promises.unlink(singletonLockPath)
|
await fs.promises.unlink(singletonLockPath)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue