Skip to content

Commit

Permalink
Merge pull request tellomichmich#65 from gabi92a/patch-4
Browse files Browse the repository at this point in the history
Update: Added TimeOut method
  • Loading branch information
tellomichmich authored Sep 7, 2016
2 parents e09c069 + fc03249 commit cb87670
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,26 @@ def KillNoxProcess():
except:
ERROR_LOG("The program could not be killed")

#The process is closed if it has reached the maximum number of consecutive errors
TimeOutValue = 0
TimeOutValueMax = 20
def CallTimeOut():
if BugTimeOutValue == TimeOutValueMax:
KillNoxProcess()
TimeOutValue = 0
else:
TimeOutValue += 1

#Reset the value if consecutive errors no longer occur
def ResetTimeOut():
TimeOutValue = 0

def GetTimeOutValue():
return TimeOutValue

def GetTimeOutValueMax():
return TimeOutValueMax

def LevenshteinDistance(first, second):
"""Find the Levenshtein distance between two strings."""
if len(first) > len(second):
Expand Down

0 comments on commit cb87670

Please sign in to comment.