Allow to restart mid-day without re-tooting the whole day.
This commit is contained in:
parent
0df5876fbd
commit
b852ab1613
|
@ -144,6 +144,9 @@ def live_toot(talks, mastodon: Mastodon, ahead_days=0):
|
|||
delta = (
|
||||
talk.start_date - datetime.now(timezone.utc) - timedelta(days=ahead_days)
|
||||
)
|
||||
if delta.total_seconds() < -300:
|
||||
logging.info("Skipping %s (already happened).", talk.title)
|
||||
continue
|
||||
if delta.total_seconds() > 10:
|
||||
logging.info("Waiting %s for %s to start.", delta, talk.title)
|
||||
sleep(delta.total_seconds() - 2) # Wait for the talk to start.
|
||||
|
|
Loading…
Reference in New Issue