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
...
@@ -145,23 +145,19 @@ module IGeTui
req
=
Net
::
HTTP
::
Post
.
new
(
url
.
path
,
initheader
=
{
'Content-Type'
=>
'application/json'
})
req
=
Net
::
HTTP
::
Post
.
new
(
url
.
path
,
initheader
=
{
'Content-Type'
=>
'application/json'
})
req
.
body
=
data
req
.
body
=
data
is_fail
=
true
retry_time_limit
=
3
try_time
=
0
try_time
=
0
begin
while
is_fail
&&
try_time
<
retry_time_limit
res
=
Net
::
HTTP
.
new
(
url
.
host
,
url
.
port
).
start
{
|
http
|
http
.
request
(
req
)
}
begin
rescue
=>
e
res
=
Net
::
HTTP
.
new
(
url
.
host
,
url
.
port
).
start
{
|
http
|
http
.
request
(
req
)
}
try_time
+=
1
is_fail
=
false
if
try_time
>=
3
rescue
raise
e
is_fail
=
true
else
try_time
+=
1
retry
puts
(
'try '
+
try_time
.
to_s
+
' time failed, time out.'
)
end
end
end
end
JSON
.
parse
res
.
body
JSON
.
parse
res
.
body
end
end
end
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