Skip to content

Commit

Permalink
don't reuse same connection
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Apr 18, 2018
1 parent 4a0325b commit 5145759
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .deploy/create-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def main():

release_files=create_dumps()

conn=http.client.HTTPSConnection('api.github.com')


headers={
'User-Agent': 'Deploy-Script',
Expand All @@ -205,6 +205,7 @@ def main():
# this allows to create the release from github website
url='/repos/{repo_slug}/releases/latest'.format(
repo_slug=os.environ['TRAVIS_REPO_SLUG'])
conn=http.client.HTTPSConnection('api.github.com')
conn.request('GET', url, headers=headers)
response=conn.getresponse()
release=json.loads(response.read().decode())
Expand All @@ -213,6 +214,7 @@ def main():
url='/repos/{repo_slug}/releases/{id}'.format(
repo_slug=os.environ['TRAVIS_REPO_SLUG'],
id=release['id'])
conn=http.client.HTTPSConnection('api.github.com')
conn.request('DELETE', url, headers=headers)
response=conn.getresponse()
if response.status == 204:
Expand All @@ -228,6 +230,7 @@ def main():
data=json.dumps(create_raw_data)
url='/repos/{repo_slug}/releases'.format(
repo_slug=os.environ['TRAVIS_REPO_SLUG'])
conn=http.client.HTTPSConnection('api.github.com')
conn.request('POST', url, body=data, headers=headers)
response=conn.getresponse()
release=json.loads(response.read().decode())
Expand Down

0 comments on commit 5145759

Please sign in to comment.