fix: valid SingletonLock location

This commit is contained in:
Anton Voylenko 2024-12-03 10:38:53 +02:00
commit 60eaf676f5

View file

@ -126,10 +126,9 @@ 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}-${sessionId}`, 'SingletonLock') const singletonLockPath = path.join(sessionFolderPath, `session-${sessionId}`, 'SingletonLock')
const singletonLockExists = await fs.promises.access(singletonLockPath).then(() => true).catch(() => false) const singletonLockExists = await fs.promises.access(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)