billing: bomb out early if we have unsent logs to avoid duplicating work that's never used
This commit is contained in:
@ -805,7 +805,8 @@ class BillingServlet:
|
|||||||
)
|
)
|
||||||
|
|
||||||
if req.traceleft > 0:
|
if req.traceleft > 0:
|
||||||
self.logger.warning(f"{req.traceleft} unsent tracelogs")
|
self.logger.info(f"Requesting 20 more of {req.traceleft} unsent tracelogs")
|
||||||
|
return PlainTextResponse("result=6&waittime=0&linelimit=20\r\n")
|
||||||
|
|
||||||
playlimit = req.playlimit
|
playlimit = req.playlimit
|
||||||
while req.playcnt > playlimit:
|
while req.playcnt > playlimit:
|
||||||
@ -825,9 +826,6 @@ class BillingServlet:
|
|||||||
resp_str = urllib.parse.unquote(urllib.parse.urlencode(vars(resp))) + "\r\n"
|
resp_str = urllib.parse.unquote(urllib.parse.urlencode(vars(resp))) + "\r\n"
|
||||||
|
|
||||||
self.logger.debug(f"response {vars(resp)}")
|
self.logger.debug(f"response {vars(resp)}")
|
||||||
if req.traceleft > 0: # TODO: should probably move this up so we don't do a ton of work that doesn't get used
|
|
||||||
self.logger.info(f"Requesting 20 more of {req.traceleft} unsent tracelogs")
|
|
||||||
return PlainTextResponse("result=6&waittime=0&linelimit=20\r\n")
|
|
||||||
|
|
||||||
return PlainTextResponse(resp_str)
|
return PlainTextResponse(resp_str)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user