mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Ensure that time is monotonic when running autocompile
This commit is contained in:
parent
4a490aafbf
commit
38eaf82c65
1 changed files with 4 additions and 1 deletions
|
@ -80,8 +80,11 @@ define [
|
|||
return if autoCompileTimeout
|
||||
|
||||
timeSinceLastCompile = Date.now() - $scope.recompiledAt
|
||||
# If time is non-monotonic, assume that the user's system clock has been
|
||||
# changed and continue with recompile
|
||||
isTimeNonMonotonic = timeSinceLastPoll < 0;
|
||||
|
||||
if timeSinceLastCompile >= AUTO_COMPILE_TIMEOUT
|
||||
if isTimeNonMonotonic || timeSinceLastCompile >= AUTO_COMPILE_TIMEOUT
|
||||
if (!ide.$scope.hasLintingError)
|
||||
$scope.recompile(isBackgroundAutoCompile: true)
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue