We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When instantiating ThreadBasedCyclicSendTask by calling bus.send_periodic, with a certain duration, the task won't start again after calling .start
ThreadBasedCyclicSendTask
bus.send_periodic
.start
The problem is, that self.end_time is only set at init in broadcastmanager.py
self.end_time
self.end_time: Optional[float] = ( time.perf_counter() + duration if duration else None )
Then it only works the first time when the thread is started immediately
while not self.stopped: if self.end_time is not None and time.perf_counter() >= self.end_time: break
However, it should be set again, either in .start() or in _run().
.start()
_run()
I guess this might affect #1848 #1853 as well.
example_task
modifier_callback
example_task.start()
The defined periodic task should start again, with the same duration and interval.
OS and version: Ubuntu 24.04.1 LTS Python version: 3.12.3 python-can version: 4.4.2 python-can interface/s (if applicable): socketcan and IXXAT
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Describe the bug
When instantiating
ThreadBasedCyclicSendTask
by callingbus.send_periodic
, with a certain duration, the task won't start again after calling.start
The problem is, that
self.end_time
is only set at init in broadcastmanager.pyThen it only works the first time when the thread is started immediately
However, it should be set again, either in
.start()
or in_run()
.I guess this might affect #1848 #1853 as well.
To Reproduce
ThreadBasedCyclicSendTask
objectexample_task
by callingbus.send_periodic
, including amodifier_callback
and a duration of five secondsexample_task.start()
Expected behavior
The defined periodic task should start again, with the same duration and interval.
Additional context
OS and version: Ubuntu 24.04.1 LTS
Python version: 3.12.3
python-can version: 4.4.2
python-can interface/s (if applicable): socketcan and IXXAT
Traceback and logs
The text was updated successfully, but these errors were encountered: