klausi / mastodon-twitter-sync

Synchronizes posts from Mastodon to Twitter and back
GNU General Public License v3.0
245 stars 24 forks source link

fix(sync): just skip failed post instead of crashing whole application #72

Closed 9Lukas5 closed 1 year ago

9Lukas5 commented 1 year ago

(kind of) fixes #70

I had something on twitter it somehow failed to download the attachment from the tweet, for whatever reason. But as currently, if one post in either direction fails, it immediately crashes the program, all other posts that would have been fine weren't posted either.

This pull request changes the behaviour from using process::exit(i32) to just continue in these loops. This way the failed posts won't be added to the post_cache, but it doesn't block other working posts from being synced.

Don't if the bridge will even work after the 9th February, but hey, I at least get another week or so^^

klausi commented 1 year ago

Good point, thanks a lot!

This could cause a change in behavior of our sync logic, so that broken posts will be skipped forever and never be synced again, but I think that is better than getting stuck on the same error on every run.

Of course it would be much better to fix the root cause why a post fails, let me know if you have more info in the issue!