Handle replying to aa missing post
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/vulnerability-scan Pipeline was successful

This commit is contained in:
Liam Steckler 2024-09-11 19:16:52 -07:00
parent 48390aa3f2
commit c3b1952a79

17
scl.py
View file

@ -373,13 +373,16 @@ with Session(engine) as session:
), ),
) )
if max_event_class["is_postable"] and existing_record.initial_post_id: if max_event_class["is_postable"] and existing_record.initial_post_id:
post_result = mastodon_client.status_post( try:
status="\n".join(updated_entries), post_result = mastodon_client.status_post(
in_reply_to_id=existing_record.most_recent_post_id, status="\n".join(updated_entries),
visibility="unlisted", in_reply_to_id=existing_record.most_recent_post_id,
language="en", visibility="unlisted",
) language="en",
existing_record.most_recent_post_id = post_result["id"] )
existing_record.most_recent_post_id = post_result["id"]
except mastodon.MastodonNotFoundError:
print("Could not post a reply to the existing post, skip this update")
elif max_event_class["is_postable"]: elif max_event_class["is_postable"]:
print( print(
"Posting an event that grew above the threshold required to post" "Posting an event that grew above the threshold required to post"