Skip to content

Commit 210d3de

Browse files
authored
[client] fix backwards compatibility with period passed in schedule()
Signed-off-by: Antoine MAZEAS <[email protected]>
1 parent eb7089a commit 210d3de

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pyobas/helpers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,10 @@ def __init__(
290290
}
291291

292292
def schedule(self, message_callback, delay):
293+
# backwards compatibility: when older style call sets delay
294+
# and no config exists,
295+
if self.__daemon._configuration.get("collector_period") is None:
296+
self.__daemon._configuration.set("collector_period", delay)
293297
self.__daemon.set_callback(message_callback)
294298
self.__daemon.start()
295299

0 commit comments

Comments
 (0)