Commit 3dd2171e authored by Raphael Beer's avatar Raphael Beer

Fix: debug not available

parent a9a23784
...@@ -442,7 +442,7 @@ class TwitterSession: ...@@ -442,7 +442,7 @@ class TwitterSession:
if result["tests"]["search"] != False: if result["tests"]["search"] != False:
debug('Requesting TimelineTermination status for more_replies.tweet [' + result["tests"]["search"] + ']') debug('Requesting TimelineTermination status for more_replies.tweet [' + result["tests"]["search"] + ']')
result["tests"]["timeline_termination"] = await TimelineTermination.requestTest(result["tests"]["search"]) result["tests"]["timeline_termination"] = await TimelineTermination.requestTest(result["tests"]["search"], debug)
debug('Writing result for ' + result['profile']['screen_name'] + ' to DB') debug('Writing result for ' + result['profile']['screen_name'] + ' to DB')
db.write_result(result) db.write_result(result)
......
...@@ -5,12 +5,11 @@ class TimelineTermination: ...@@ -5,12 +5,11 @@ class TimelineTermination:
endpoint = None endpoint = None
session = ClientSession() session = ClientSession()
async def requestTest(tweet_id): async def requestTest(tweet_id, debug):
async with TimelineTermination.session.get(TimelineTermination.endpoint + tweet_id) as response: async with TimelineTermination.session.get(TimelineTermination.endpoint + tweet_id) as response:
result = await response.json() result = await response.json()
if result.get("name", None) == "APIError" and result["errors"][0]["code"] == "ENOREPLIES": if result.get("name", None) == "APIError" and result["errors"][0]["code"] == "ENOREPLIES":
global debug
debug('[TimelineTermination] ' + tweet_id + 'has no replies - can not test.') debug('[TimelineTermination] ' + tweet_id + 'has no replies - can not test.')
result = None result = None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment