Skip to content

Fix handling of 'forever' delay (fixes #125) - #253

Open
ronnix wants to merge 1 commit into
lepture:masterfrom
ronnix:delay-forever
Open

ronnix wants to merge 1 commit into
lepture:masterfrom
ronnix:delay-forever

Conversation

@ronnix

@ronnix ronnix commented Sep 14, 2021

Copy link
Copy Markdown

This PR builds on the work in #236 and avoids comparing strings and floats when computing the max delay.

ronnix added a commit to Delegation-numerique-en-sante/mesconseilscovid that referenced this pull request Sep 14, 2021
ronnix added a commit to Delegation-numerique-en-sante/mesconseilscovid that referenced this pull request Sep 14, 2021
ronnix added a commit to Delegation-numerique-en-sante/mesconseilscovid that referenced this pull request Sep 14, 2021
Comment thread livereload/watcher.py
func = item['func']
delay = item['delay']
if delay and isinstance(delay, float):
if delay and isinstance(delay, float) or delay == 'forever':

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this PR but seems like we should also fix isinstance(delay, float) to isinstance(10, (int, float)).
What do you think?

johbo added a commit to johbo/python-livereload that referenced this pull request Sep 20, 2026
The sentinel was filtered out by the isinstance check that collects
numeric delays, so it never reached poll_tasks and a watch asking not
to reload the browser still reloaded it.

Based on lepture#253, keeping the sentinel out of the numeric set so that
max() never sees a string.
johbo added a commit to johbo/python-livereload that referenced this pull request Sep 20, 2026
The sentinel was filtered out by the isinstance check that collects
numeric delays, so it never reached poll_tasks and a watch asking not
to reload the browser still reloaded it.

Based on lepture#253, keeping the sentinel out of the numeric set so that
max() never sees a string.
johbo added a commit to johbo/python-livereload that referenced this pull request Sep 20, 2026
The sentinel was filtered out by the isinstance check that collects
numeric delays, so it never reached poll_tasks and a watch asking not
to reload the browser still reloaded it.

Based on lepture#253, keeping the sentinel out of the numeric set so that
max() never sees a string.
@johbo

johbo commented Sep 20, 2026

Copy link
Copy Markdown

Did land here when trying to investigate why forever did not work. Would be great if the problem could be fixed, added #289 as a slightly modified version of this PR. Hope there is a chance that one of them could be accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants