File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
src/frequenz/channels/util Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -417,6 +417,11 @@ def __init__(
417417 ValueError: if `interval` is not positive or is smaller than 1
418418 microsecond.
419419 """
420+ if interval < timedelta (microseconds = 1 ):
421+ raise ValueError (
422+ f"The `interval` must be positive and at least 1 microsecond, not { interval } "
423+ )
424+
420425 self ._interval : int = _to_microseconds (interval )
421426 """The time to between timer ticks."""
422427
@@ -464,12 +469,6 @@ def __init__(
464469 to wait again.
465470 """
466471
467- if self ._interval <= 0 :
468- raise ValueError (
469- "The `interval` must be positive and at least 1 microsecond, "
470- f"not { interval } ({ self ._interval } microseconds)"
471- )
472-
473472 if auto_start :
474473 self .reset ()
475474
You can’t perform that action at this time.
0 commit comments