change sync to async for lockfile debugging
This commit is contained in:
@@ -16,8 +16,10 @@ module.exports = LockManager =
|
|||||||
stale: @LOCK_STALE
|
stale: @LOCK_STALE
|
||||||
Lockfile.lock path, lockOpts, (error) ->
|
Lockfile.lock path, lockOpts, (error) ->
|
||||||
return callback new Errors.AlreadyCompilingError("compile in progress") if error?.code is 'EEXIST'
|
return callback new Errors.AlreadyCompilingError("compile in progress") if error?.code is 'EEXIST'
|
||||||
|
fs.lstat path, (err, statLock)->
|
||||||
|
fs.lstat Path.dirname(path), (err, statDir)->
|
||||||
if error?
|
if error?
|
||||||
logger.err error:error, path:path, statLock:fs.lstatSync(path), statDir: fs.lstatSync(path.dirname(path)), "unable to get lock"
|
logger.err error:error, path:path, statLock:statLock, statDir: statDir, "unable to get lock"
|
||||||
return callback(error)
|
return callback(error)
|
||||||
runner (error1, args...) ->
|
runner (error1, args...) ->
|
||||||
Lockfile.unlock path, (error2) ->
|
Lockfile.unlock path, (error2) ->
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ describe "DockerLockManager", ->
|
|||||||
@LockManager = SandboxedModule.require modulePath, requires:
|
@LockManager = SandboxedModule.require modulePath, requires:
|
||||||
"settings-sharelatex": {}
|
"settings-sharelatex": {}
|
||||||
"logger-sharelatex": @logger = { log: sinon.stub(), error: sinon.stub() }
|
"logger-sharelatex": @logger = { log: sinon.stub(), error: sinon.stub() }
|
||||||
|
"fs":
|
||||||
|
lstat:sinon.stub().callsArgWith(1)
|
||||||
"lockfile": @Lockfile = {}
|
"lockfile": @Lockfile = {}
|
||||||
@lockFile = "/local/compile/directory/.project-lock"
|
@lockFile = "/local/compile/directory/.project-lock"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user