Compare commits

...

3 Commits

Author SHA1 Message Date
Fierelier b00d217400 Set req's sleep time to 0 2021-07-01 01:33:23 +02:00
Fierelier bbd7fc1ad6 Add set-able command sleep time 2021-07-01 01:32:59 +02:00
Fierelier be2b300afb Add file lock 2021-07-01 01:32:25 +02:00
2 changed files with 10 additions and 2 deletions

View File

@ -44,6 +44,8 @@ heartbeatTime = 600
threadCount = 0
threadCountLock = threading.Lock()
fileLock = threading.Lock()
commands = {}
def commandlineToList(cmd):
@ -232,7 +234,12 @@ class connectionThreadIn(threading.Thread):
return ["error","nonfatal","command_not_found"]
command = commands[cmd[0]]
rtn = command["function"](self,cmd)
time.sleep(pauseBetweenCommands)
sleep = pauseBetweenCommands
if "sleep" in command:
sleep = command["sleep"]
if sleep > 0: time.sleep(sleep)
return rtn
def run(self):

View File

@ -6,4 +6,5 @@ def f(self,cmd):
rtn = cmd[:2] + self.runCommand(cmd[2:])
return rtn
commands["req"]["function"] = f
commands["req"]["function"] = f
commands["req"]["sleep"] = 0