INNER CODE UNIT · Python
seconds_until_expiry
yihong1120/Construction-Hazard-Detection · main.py:313
seconds_until_expiry = (expiry - now).total_seconds()
if seconds_until_expiry > 0:
delay = min(delay, seconds_until_expiry)
return max(0.1, delay)
async def reload_configurations(self) -> None:
"""
Main configuration reload logic:
- Stops disabled, expired, or deleted stream processes
- Restarts modified streams (based on updated_at)
- Starts newly added streams not yet tracked
"""
async with self.lock:
configs = await self.fetch_stream_configs()
cfg_map = {
self._stream_process_key(config): config for config in configs
}