Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Mastodon
Commits
fb6aa7ad
Commit
fb6aa7ad
authored
8 years ago
by
Eugen Rochko
Browse files
Options
Downloads
Patches
Plain Diff
Add tracking of delay to streaming API
parent
6cdcac13
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/assets/javascripts/components/features/ui/containers/modal_container.jsx
+1
-1
1 addition, 1 deletion
...pts/components/features/ui/containers/modal_container.jsx
app/lib/feed_manager.rb
+1
-0
1 addition, 0 deletions
app/lib/feed_manager.rb
streaming/index.js
+11
-5
11 additions, 5 deletions
streaming/index.js
with
13 additions
and
6 deletions
app/assets/javascripts/components/features/ui/containers/modal_container.jsx
+
1
−
1
View file @
fb6aa7ad
...
...
@@ -123,7 +123,7 @@ const Modal = React.createClass({
window
.
addEventListener
(
'
keyup
'
,
this
.
_listener
);
},
component
Did
Unmount
()
{
component
Will
Unmount
()
{
window
.
removeEventListener
(
'
keyup
'
,
this
.
_listener
);
},
...
...
This diff is collapsed.
Click to expand it.
app/lib/feed_manager.rb
+
1
−
0
View file @
fb6aa7ad
...
...
@@ -30,6 +30,7 @@ class FeedManager
end
def
broadcast
(
timeline_id
,
options
=
{})
options
[
:queued_at
]
=
(
Time
.
now
.
to_f
*
1000.0
).
to_i
ActionCable
.
server
.
broadcast
(
"timeline:
#{
timeline_id
}
"
,
options
)
end
...
...
This diff is collapsed.
Click to expand it.
streaming/index.js
+
11
−
5
View file @
fb6aa7ad
...
...
@@ -101,7 +101,15 @@ const streamFrom = (redisClient, id, req, output, needsFiltering = false) => {
log
.
verbose
(
`Starting stream from
${
id
}
for
${
req
.
accountId
}
`
)
redisClient
.
on
(
'
message
'
,
(
channel
,
message
)
=>
{
const
{
event
,
payload
}
=
JSON
.
parse
(
message
)
const
{
event
,
payload
,
queued_at
}
=
JSON
.
parse
(
message
)
const
transmit
=
()
=>
{
const
now
=
new
Date
().
getTime
()
const
delta
=
now
-
queued_at
;
log
.
silly
(
`Transmitting for
${
req
.
accountId
}
:
${
event
}
${
payload
}
Delay:
${
delta
}
ms`
)
output
(
event
,
payload
)
}
// Only messages that may require filtering are statuses, since notifications
// are already personalized and deletes do not matter
...
...
@@ -127,13 +135,11 @@ const streamFrom = (redisClient, id, req, output, needsFiltering = false) => {
return
}
log
.
silly
(
`Transmitting for
${
req
.
accountId
}
:
${
event
}
${
payload
}
`
)
output
(
event
,
payload
)
transmit
()
})
})
}
else
{
log
.
silly
(
`Transmitting for
${
req
.
accountId
}
:
${
event
}
${
payload
}
`
)
output
(
event
,
payload
)
transmit
()
}
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment