This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Description
If DSN is not provided at all (e.g. because of the misconfigured environment), advisory-lock silently fails to lock:
> require('advisory-lock').default()('test').tryLock().then(locked => console.log('locked', locked)).catch(console.error)
> locked false
With proper DSN it works:
> require('advisory-lock').default('postgresql://localhost/test')('test').tryLock().then(locked => console.log('locked', locked)).catch(console.error)
> locked true
With wrong DSN it fails (as expected):
> require('advisory-lock').default('postgresql://localhost/no_such_db')('test').tryLock().then(locked => console.log('locked', locked)).catch(console.error)
> { error: database "no_such_db" does not exist ...
Expected behaviour
With undefined DSN, an error is thrown.