Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
gab
social
gab-social
Commits
213d5862
Commit
213d5862
authored
Aug 09, 2019
by
2458773093
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fan out to group members
parent
c8ce87e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
app/models/concerns/group_interactions.rb
app/models/concerns/group_interactions.rb
+6
-0
app/services/fan_out_on_write_service.rb
app/services/fan_out_on_write_service.rb
+12
-0
No files found.
app/models/concerns/group_interactions.rb
View file @
213d5862
...
...
@@ -28,4 +28,10 @@ module GroupInteractions
end
end
def
accounts_for_local_distribution
accounts
.
local
.
joins
(
:user
)
.
where
(
'users.current_sign_in_at > ?'
,
User
::
ACTIVE_DURATION
.
ago
)
end
end
app/services/fan_out_on_write_service.rb
View file @
213d5862
...
...
@@ -46,6 +46,16 @@ class FanOutOnWriteService < BaseService
end
end
def
deliver_to_group_members
(
status
)
Rails
.
logger
.
debug
"Delivering status
#{
status
.
id
}
to group members
#{
status
.
group
.
id
}
"
status
.
group
.
accounts_for_local_distribution
.
select
(
:id
).
reorder
(
nil
).
find_in_batches
do
|
members
|
FeedInsertWorker
.
push_bulk
(
members
)
do
|
member
|
[
status
.
id
,
member
.
id
,
:home
]
end
end
end
def
deliver_to_lists
(
status
)
Rails
.
logger
.
debug
"Delivering status
#{
status
.
id
}
to lists"
...
...
@@ -62,6 +72,8 @@ class FanOutOnWriteService < BaseService
Rails
.
logger
.
debug
"Delivering status
#{
status
.
id
}
to group"
Redis
.
current
.
publish
(
"timeline:group:
#{
status
.
group_id
}
"
,
@payload
)
deliver_to_group_members
(
status
)
end
def
deliver_to_mentioned_followers
(
status
)
...
...
Developer
🥊
@mgabdev
mentioned in commit
3fc85407
·
Aug 29, 2019
mentioned in commit
3fc85407
mentioned in commit 3fc85407ed56dc622c40cf77b7178003bb85d034
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment