Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update request future (#1) #2

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

Update request future (#1)

* Update requirements.txt

* Update handlers.py

deprecate 'background_callback', use hooks
  • Loading branch information
wangsha committed Dec 4, 2018
commit 35a3e1902f49ff17ed9d6caf447d6eb70554822f
@@ -9,10 +9,12 @@
session = FuturesSession()


def bg_cb(sess, resp):

def bg_cb(resp, *args, **kwargs):

This comment has been minimized.

@lancondrej

lancondrej Jan 2, 2019

I prefer to rename it to response_hook because it is not background callback anymore.

This comment has been minimized.

@wangsha

wangsha Jan 2, 2019
Author

updated

""" Don't do anything with the response """
pass

session.hooks['response'] = bg_cb

class HTTPSHandler(logging.Handler):
def __init__(self, url, fqdn=False, localname=None, facility=None):
@@ -31,8 +33,8 @@ def get_full_message(self, record):
def emit(self, record):
try:
payload = self.format(record)
session.post(self.url, data=payload, background_callback=bg_cb)
session.post(self.url, data=payload)
except (KeyboardInterrupt, SystemExit):
raise
except:
self.handleError(record)
self.handleError(record)
@@ -2,4 +2,4 @@ coverage==3.7.1
flake8==2.1.0
mock==1.0.1
nose==1.3.0
requests-futures==0.9.4
requests-futures>=0.9.9

This comment has been minimized.

@lancondrej

lancondrej Jan 2, 2019

Please change this dependency also in setup.py

This comment has been minimized.

@wangsha

wangsha Jan 2, 2019
Author

updated

This comment has been minimized.

@jerson00

jerson00 Nov 12, 2019

waiting for this merge, any update?

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.