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 #4

Closed
wants to merge 3 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

Update handlers.py

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


def bg_cb(sess, resp):

def bg_cb(resp, *args, **kwargs):
""" 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)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.