Error while scheduling stream, logs crowded with redundant "Wait a Little Bit Until Preloading Is Done..." messages

When scheduling a stream (http://stream.fro.at:8008/fro-128.ogg), I get an error:

engine                 | 2024-02-22 12:42:44,816:engine:INFO - === preload('PlaylistEntry #5 [12:43:00 - 12:45:00 | 120.0sec | Source: ...m.fro.at:8008/fro-128.ogg]') === - [scheduler.py:550-do_preload()]
engine                 | 2024-02-22 12:42:44,816:engine:INFO - Got free 'http' channel 'in_stream_0' - [mixer.py:150-get_free_channel()]
engine                 | 2024-02-22 12:42:44,816:engine:INFO - Assign channel [2 : in_stream_0] to entry - [engine.py:318-preload()]
engine                 | 2024-02-22 12:42:44,819:engine:INFO - in_stream_0.start result: Done! - [channels.py:529-start()]
engine                 | 2024-02-22 12:42:44,820:engine:INFO - in_stream_0.status result: polling - [channels.py:482-is_ready()]
engine                 | Exception in thread PRELOAD#10:do_preload:2024-02-22_12:42:45:
engine                 | Traceback (most recent call last):
engine                 |   File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
engine                 |     self.run()
engine                 |   File "/usr/local/lib/python3.10/threading.py", line 1378, in run
engine                 |     self.function(*self.args, **self.kwargs)
engine                 |   File "/srv/src/aura_engine/control.py", line 166, in wrapper_func
engine                 |     self.func(
engine                 |   File "/srv/src/aura_engine/scheduling/scheduler.py", line 551, in do_preload
engine                 |     self.engine.player.preload(entries[0])
engine                 |   File "/srv/src/aura_engine/engine.py", line 320, in preload
engine                 |     is_ready = entry.channel.load(uri, metadata=metadata)
engine                 |   File "/srv/src/aura_engine/core/channels.py", line 452, in load
engine                 |     if retries >= max_retries:
engine                 | TypeError: '>=' not supported between instances of 'int' and 'NoneType'

As a result engine keeps logging this continously:

engine                 | 2024-02-22 12:57:54,734:engine:INFO - PLAY: Wait a little bit until preloading is done ... - [scheduler.py:573-do_play()]
engine                 | 2024-02-22 12:57:56,737:engine:INFO - PLAY: Wait a little bit until preloading is done ... - [scheduler.py:573-do_play()]
engine                 | 2024-02-22 12:57:58,737:engine:INFO - PLAY: Wait a little bit until preloading is done ... - [scheduler.py:573-do_play()]
engine                 | 2024-02-22 12:58:00,740:engine:INFO - PLAY: Wait a little bit until preloading is done ... - [scheduler.py:573-do_play()]
engine                 | 2024-02-22 12:58:02,741:engine:INFO - PLAY: Wait a little bit until preloading is done ... - [scheduler.py:573-do_play()]

Original ticket description, which had the same cause:

The log file of engine is experiencing an overflow of repetitive log entries containing the message PLAY: Wait a little bit until preloading is done .... I left engine running over night and hat 73 000 entries of only this message. This excessive logging is making it challenging to identify other important log information. I would suggest to optimize the logging to maintain clarity in the log file.

Edited by David Trattnig