Closed aarronc closed 6 years ago
if self.__reset(cmdr=cmdr) or entry['event'] == 'Scan' or not self.ready:
self.__check_again()
I don't think it's self.__reset
and there's no Scan
in the log so self.ready
might be stuck by the JSON never parsing. OR maybe I stuffed up xmit
with that fix to local
.
try:
return response.json()
No, that's pretty definitive. Only happens on 200, but you're replying with 200.
I'll give it a poke after breakfast if I decide to stay home.
@aarronc you'll need to change __check_again_action
in exploration.py
and tell me what you see in the output when you python EDMarketconnector.py
:
def __check_again_action(self):
"Get and display exploration credits."
if self.checking:
return
try:
self.checking = True
path = '/explocredit.json/{}'.format(self.cmdr)
json_data = xmit.get(path)
print '=== A', json_data
self.credits = float(json_data['ExploCredits'])
print '=== B', self.credits
if self.textvariable:
self.textvariable.set("at least {:,.0f}".format(self.credits))
self.refresh()
finally:
self.checking = False
I'm getting:
200 GET http://forthemug.com:4567/explocredit.json/sporebat ms=2771
=== A {u'ExploCredits': u'0'}
=== B 0.0
... and then it's self.ready
and it stops asking.
@aarronc if the server is getting slugged, it'd be very handy to have a copy of the JSON returned from /explocredit.json/{}
for your alt with a space in its name. (Though, hang on: if Dave
from the log in #67 doesn't have a space, maybe there's something else causing the JSON to be mangled.)
If your server side framework lets you, please try parsing the JSON you're about to return, check that it has an ExploCredits
that's a number, and crash out with a 500 if not. I do this kind of structural check on all my professional work. It genuinely helps.
Meanwhile, I'll work on a client side mitigation for your explocredit.json
getting slugged because it's consistently not returning what these few commanders' copies of the Helper expect.
Root cause fixed at the server end. Mitigation still in place at the client end.
it looks as if explocredit.json is being requested after alot of different journal events. it even requests it when I hire and fire a crew member, this may bog down the HH back end with requests with a lot of new people upgrading soon.