[DEBUG] correct server down when to low activity
This commit is contained in:
parent
adbb307895
commit
bbc619ef84
@ -10,6 +10,7 @@ import urllib, urllib2
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import argparse
|
import argparse
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
@ -99,9 +100,19 @@ data = urllib.urlencode({'REPO':args.repo,
|
|||||||
'TAG':args.tag,
|
'TAG':args.tag,
|
||||||
'STATUS':args.status,
|
'STATUS':args.status,
|
||||||
'ID':args.id})
|
'ID':args.id})
|
||||||
|
# I do this because my server is sometime down and need time to restart (return 408)
|
||||||
|
send_done = 5
|
||||||
|
while send_done >= 0:
|
||||||
|
send_done = send_done - 1
|
||||||
|
try:
|
||||||
|
req = urllib2.Request(args.url, data)
|
||||||
|
response = urllib2.urlopen(req)
|
||||||
|
send_done = -1
|
||||||
|
except urllib2.HTTPError:
|
||||||
|
print("An error occured (maybe on server or network ... 'urllib2.HTTPError: HTTP Error 408: Request Timeout' ")
|
||||||
|
if send_done >= 0:
|
||||||
|
time.sleep(5)
|
||||||
|
|
||||||
req = urllib2.Request(args.url, data)
|
|
||||||
response = urllib2.urlopen(req)
|
|
||||||
#print(response.geturl())
|
#print(response.geturl())
|
||||||
#print(response.info())
|
#print(response.info())
|
||||||
return_data = response.read()
|
return_data = response.read()
|
||||||
|
@ -10,6 +10,7 @@ import urllib, urllib2
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import argparse
|
import argparse
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
@ -104,9 +105,18 @@ data = urllib.urlencode({'REPO':args.repo,
|
|||||||
'SHA1':args.sha1,
|
'SHA1':args.sha1,
|
||||||
'LIB_BRANCH':args.branch,
|
'LIB_BRANCH':args.branch,
|
||||||
'JSON_FILE':json_data})
|
'JSON_FILE':json_data})
|
||||||
|
# I do this because my server is sometime down and need time to restart (return 408)
|
||||||
req = urllib2.Request(args.url, data)
|
send_done = 5
|
||||||
response = urllib2.urlopen(req)
|
while send_done >= 0:
|
||||||
|
send_done = send_done - 1
|
||||||
|
try:
|
||||||
|
req = urllib2.Request(args.url, data)
|
||||||
|
response = urllib2.urlopen(req)
|
||||||
|
send_done = -1
|
||||||
|
except urllib2.HTTPError:
|
||||||
|
print("An error occured (maybe on server or network ... 'urllib2.HTTPError: HTTP Error 408: Request Timeout' ")
|
||||||
|
if send_done >= 0:
|
||||||
|
time.sleep(5)
|
||||||
#print response.geturl()
|
#print response.geturl()
|
||||||
#print response.info()
|
#print response.info()
|
||||||
return_data = response.read()
|
return_data = response.read()
|
||||||
|
16
test_send.py
16
test_send.py
@ -10,6 +10,7 @@ import urllib, urllib2
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import argparse
|
import argparse
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
@ -170,9 +171,18 @@ data = urllib.urlencode({'REPO':args.repo,
|
|||||||
'SHA1':args.sha1,
|
'SHA1':args.sha1,
|
||||||
'JSON_FILE':json_data,
|
'JSON_FILE':json_data,
|
||||||
'LIB_BRANCH':args.branch})
|
'LIB_BRANCH':args.branch})
|
||||||
|
# I do this because my server is sometime down and need time to restart (return 408)
|
||||||
req = urllib2.Request(args.url, data)
|
send_done = 5
|
||||||
response = urllib2.urlopen(req)
|
while send_done >= 0:
|
||||||
|
send_done = send_done - 1
|
||||||
|
try:
|
||||||
|
req = urllib2.Request(args.url, data)
|
||||||
|
response = urllib2.urlopen(req)
|
||||||
|
send_done = -1
|
||||||
|
except urllib2.HTTPError:
|
||||||
|
print("An error occured (maybe on server or network ... 'urllib2.HTTPError: HTTP Error 408: Request Timeout' ")
|
||||||
|
if send_done >= 0:
|
||||||
|
time.sleep(5)
|
||||||
#print response.geturl()
|
#print response.geturl()
|
||||||
#print response.info()
|
#print response.info()
|
||||||
return_data = response.read()
|
return_data = response.read()
|
||||||
|
@ -11,6 +11,7 @@ import sys
|
|||||||
import os
|
import os
|
||||||
import argparse
|
import argparse
|
||||||
import fnmatch
|
import fnmatch
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
@ -184,9 +185,18 @@ data = urllib.urlencode({'REPO':args.repo,
|
|||||||
'SHA1':args.sha1,
|
'SHA1':args.sha1,
|
||||||
'LIB_BRANCH':args.branch,
|
'LIB_BRANCH':args.branch,
|
||||||
'JSON_FILE':json_data})
|
'JSON_FILE':json_data})
|
||||||
|
# I do this because my server is sometime down and need time to restart (return 408)
|
||||||
req = urllib2.Request(args.url, data)
|
send_done = 5
|
||||||
response = urllib2.urlopen(req)
|
while send_done >= 0:
|
||||||
|
send_done = send_done - 1
|
||||||
|
try:
|
||||||
|
req = urllib2.Request(args.url, data)
|
||||||
|
response = urllib2.urlopen(req)
|
||||||
|
send_done = -1
|
||||||
|
except urllib2.HTTPError:
|
||||||
|
print("An error occured (maybe on server or network ... 'urllib2.HTTPError: HTTP Error 408: Request Timeout' ")
|
||||||
|
if send_done >= 0:
|
||||||
|
time.sleep(5)
|
||||||
#print response.geturl()
|
#print response.geturl()
|
||||||
#print response.info()
|
#print response.info()
|
||||||
return_data = response.read()
|
return_data = response.read()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user