This website works better with JavaScript.
Home
Explore
Help
Sign In
closed-social
/
mastodon
Watch
3
Star
0
Fork
2
Code
Issues
5
Pull Requests
0
Projects
0
Releases
3
Wiki
Activity
Browse Source
Move Salmon processing to background as well as PuSH
closed-social-glitch-2
Eugen Rochko
7 years ago
parent
2c58e7e06a
commit
7dea6a23f7
2 changed files
with
10 additions
and
1 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+1
-1
app/controllers/api/salmon_controller.rb
+9
-0
app/workers/salmon_worker.rb
+ 1
- 1
app/controllers/api/salmon_controller.rb
View File
@ -10,7 +10,7 @@ class Api::SalmonController < ApiController
if
body
.
nil?
head
200
else
ProcessInteractionService
.
new
.
call
(
body
,
@account
)
SalmonWorker
.
perform_async
(
@account
.
id
,
body
.
force_encoding
(
'UTF-8'
)
)
head
201
end
end
+ 9
- 0
app/workers/salmon_worker.rb
View File
@ -0,0 +1,9 @@
# frozen_string_literal: true
class
SalmonWorker
include
Sidekiq
::
Worker
def
perform
(
account_id
,
body
)
ProcessInteractionService
.
new
.
call
(
body
,
Account
.
find
(
account_id
)
)
end
end
Write
Preview
Loading…
Cancel
Save