Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
app_push
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_server
app_push
Commits
953eb382
Commit
953eb382
authored
5 years ago
by
李福中
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make push timeout adjustable
parent
ddb1aa07
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
+6
-1
app/controllers/pushs_controller.rb
+6
-1
No files found.
app/controllers/pushs_controller.rb
View file @
953eb382
...
@@ -33,10 +33,15 @@ class PushsController < ApplicationController
...
@@ -33,10 +33,15 @@ class PushsController < ApplicationController
token
=
token_and_options
(
request
).
first
token
=
token_and_options
(
request
).
first
if
token
==
Token
.
token
(
params
[
:app_name
])
if
token
==
Token
.
token
(
params
[
:app_name
])
if
params
.
has_key?
(
:sync_push
)
if
params
.
has_key?
(
:sync_push
)
Timeout
.
timeout
(
3
)
{
timeout_seconds
=
$redis
.
get
(
'push_timeout'
).
to_i
if
timeout_seconds
>
0
Timeout
.
timeout
(
timeout_seconds
)
{
::
PushWorker
.
new
.
perform
(
device_ids_opts
,
message
,
igetui_opts
,
params
[
:app_type
])
::
PushWorker
.
new
.
perform
(
device_ids_opts
,
message
,
igetui_opts
,
params
[
:app_type
])
}
}
else
else
::
PushWorker
.
new
.
perform
(
device_ids_opts
,
message
,
igetui_opts
,
params
[
:app_type
])
end
else
::
PushWorker
.
perform_async
(
device_ids_opts
,
message
,
igetui_opts
,
params
[
:app_type
])
::
PushWorker
.
perform_async
(
device_ids_opts
,
message
,
igetui_opts
,
params
[
:app_type
])
end
end
render
json:
{
code:
0
,
message:
'success'
,
describe:
'异步任务正在处理'
}
render
json:
{
code:
0
,
message:
'success'
,
describe:
'异步任务正在处理'
}
...
...
This diff is collapsed.
Click to expand it.
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