mirror of
https://git.ondrovo.com/MightyPork/group-actor.git
synced 2024-11-25 01:21:02 +00:00
sleep after posting
This commit is contained in:
parent
6734917d9c
commit
e5ce0bdeb7
4 changed files with 5 additions and 8 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,3 +5,4 @@ group-actor-data.toml
|
||||||
groups.json
|
groups.json
|
||||||
fedigroups
|
fedigroups
|
||||||
*.bak
|
*.bak
|
||||||
|
groups.d/
|
|
@ -556,7 +556,9 @@ mod test {
|
||||||
assert!(RE_A_HASHTAG.is_match("#banana"));
|
assert!(RE_A_HASHTAG.is_match("#banana"));
|
||||||
assert!(RE_A_HASHTAG.is_match("#ласточка"));
|
assert!(RE_A_HASHTAG.is_match("#ласточка"));
|
||||||
assert!(RE_A_HASHTAG.is_match("#χαλβάς"));
|
assert!(RE_A_HASHTAG.is_match("#χαλβάς"));
|
||||||
|
assert!(RE_A_HASHTAG.is_match("#городДляЛюдей"));
|
||||||
assert!(RE_A_HASHTAG.is_match("foo #banana gfdfgd"));
|
assert!(RE_A_HASHTAG.is_match("foo #banana gfdfgd"));
|
||||||
|
assert!(RE_A_HASHTAG.is_match("foo #городДляЛюдей aaa"));
|
||||||
|
|
||||||
for (i, c) in RE_A_HASHTAG.captures_iter("foo #banana #χαλβάς #ласточка").enumerate() {
|
for (i, c) in RE_A_HASHTAG.captures_iter("foo #banana #χαλβάς #ласточка").enumerate() {
|
||||||
if i == 0 {
|
if i == 0 {
|
||||||
|
|
|
@ -274,6 +274,8 @@ impl<'a> ProcessMention<'a> {
|
||||||
{
|
{
|
||||||
let _ = self.client.new_status(post)
|
let _ = self.client.new_status(post)
|
||||||
.await.log_error("Failed to post");
|
.await.log_error("Failed to post");
|
||||||
|
// Sleep a bit to avoid throttling
|
||||||
|
tokio::time::sleep(Duration::from_secs(1)).await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -297,16 +297,8 @@ impl GroupHandle {
|
||||||
}
|
}
|
||||||
NotificationType::Follow => {
|
NotificationType::Follow => {
|
||||||
grp_info!(self, "New follower!");
|
grp_info!(self, "New follower!");
|
||||||
|
|
||||||
// Just greet the user always
|
// Just greet the user always
|
||||||
self.handle_new_follow(¬if_acct, notif_user_id).await;
|
self.handle_new_follow(¬if_acct, notif_user_id).await;
|
||||||
|
|
||||||
// if self.config.is_member_or_admin(¬if_acct) {
|
|
||||||
// // Already joined, just doing something silly, ignore this
|
|
||||||
// grp_debug!(self, "User already a member, ignoring");
|
|
||||||
// } else {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
NotificationType::Favourite => {}
|
NotificationType::Favourite => {}
|
||||||
NotificationType::Reblog => {}
|
NotificationType::Reblog => {}
|
||||||
|
|
Loading…
Reference in a new issue