Skip to content

Commit

Permalink
fix: timer interval set to int
Browse files Browse the repository at this point in the history
  • Loading branch information
martynia committed Nov 6, 2023
1 parent f66d9bf commit 75e824b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Pilot/pilotTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ def wrapper(self, *args, **kwargs):

class RepeatingTimer(Timer):
def run(self):
print("self.interval:", self.interval, "type: ", type(self.interval), file=sys.stderr)
while not self.finished.wait(self.interval):
self.function(*self.args, **self.kwargs)

Expand All @@ -541,6 +542,8 @@ def __init__(self, senderFunc, bufsize=10, autoflush=10):
"""

self._rlock = RLock()
print(">>>>>>>>> autoflush %s" % autoflush)
print(type(autoflush))
if autoflush > 0:
self._timer = RepeatingTimer(autoflush, self.flush)
self._timer.start()
Expand Down Expand Up @@ -1100,7 +1103,7 @@ def __initJSON2(self):
self.pilotLogging = pilotLogging.upper() == "TRUE"
self.loggerURL = pilotOptions.get("RemoteLoggerURL")
# logger buffer flush interval in seconds.
self.loggerTimerInterval = pilotOptions.get("RemoteLoggerTimerInterval", self.loggerTimerInterval)
self.loggerTimerInterval = int(pilotOptions.get("RemoteLoggerTimerInterval", self.loggerTimerInterval))
pilotLogLevel = pilotOptions.get("PilotLogLevel", "INFO")
if pilotLogLevel.lower() == "debug":
self.debugFlag = True
Expand Down

0 comments on commit 75e824b

Please sign in to comment.