Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
igetui-ruby
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_common
igetui-ruby
Commits
2a68efd6
Commit
2a68efd6
authored
Dec 29, 2016
by
徐向阳
Committed by
GitHub
Dec 29, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #issues/20
fix
https://github.com/wjp2013/igetui-ruby/issues/20
parent
de216ee7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
lib/igetui/pusher.rb
+8
-12
No files found.
lib/igetui/pusher.rb
View file @
2a68efd6
...
...
@@ -145,23 +145,19 @@ module IGeTui
req
=
Net
::
HTTP
::
Post
.
new
(
url
.
path
,
initheader
=
{
'Content-Type'
=>
'application/json'
})
req
.
body
=
data
is_fail
=
true
retry_time_limit
=
3
try_time
=
0
while
is_fail
&&
try_time
<
retry_time_limit
begin
res
=
Net
::
HTTP
.
new
(
url
.
host
,
url
.
port
).
start
{
|
http
|
http
.
request
(
req
)
}
is_fail
=
false
rescue
is_fail
=
true
try_time
+=
1
puts
(
'try '
+
try_time
.
to_s
+
' time failed, time out.'
)
begin
res
=
Net
::
HTTP
.
new
(
url
.
host
,
url
.
port
).
start
{
|
http
|
http
.
request
(
req
)
}
rescue
=>
e
try_time
+=
1
if
try_time
>=
3
raise
e
else
retry
end
end
JSON
.
parse
res
.
body
end
end
end
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