refactor: get mastodon token after ensuring feed is not empty

This commit is contained in:
VC
2022-11-09 08:40:04 +01:00
parent 31afb1cf7d
commit 291c86677e

View File

@@ -57,9 +57,6 @@ pub async fn run(config: Config) {
.map(|s| s.tweet_id);
drop(lconn);
// get Mastodon instance
let mastodon = get_mastodon_token(&mastodon_config);
// get user timeline feed (Vec<tweet>)
let mut feed =
get_user_timeline(&mastodon_config.twitter_screen_name, &token, last_tweet_id)
@@ -77,6 +74,9 @@ pub async fn run(config: Config) {
return;
}
// get Mastodon instance
let mastodon = get_mastodon_token(&mastodon_config);
// order needs to be chronological
feed.reverse();