mirror of https://gitlab.com/bashrc2/epicyon
Exception handling if busy
parent
c2cf3a0dc5
commit
d55be4d497
11
daemon.py
11
daemon.py
|
@ -1348,8 +1348,19 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.httpPrefix+':##'+self.server.domainFull+'#users#'+nickname+'#statuses#'+statusNumber+'.json'
|
self.server.httpPrefix+':##'+self.server.domainFull+'#users#'+nickname+'#statuses#'+statusNumber+'.json'
|
||||||
if os.path.isfile(postFilename):
|
if os.path.isfile(postFilename):
|
||||||
postJsonObject={}
|
postJsonObject={}
|
||||||
|
readPost=False
|
||||||
|
try:
|
||||||
with open(postFilename, 'r') as fp:
|
with open(postFilename, 'r') as fp:
|
||||||
postJsonObject=commentjson.load(fp)
|
postJsonObject=commentjson.load(fp)
|
||||||
|
readPost=True
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
if not readPost:
|
||||||
|
self.send_response(429)
|
||||||
|
self.end_headers()
|
||||||
|
self.server.GETbusy=False
|
||||||
|
return
|
||||||
|
else:
|
||||||
# Only authorized viewers get to see likes on posts
|
# Only authorized viewers get to see likes on posts
|
||||||
# Otherwize marketers could gain more social graph info
|
# Otherwize marketers could gain more social graph info
|
||||||
if not authorized:
|
if not authorized:
|
||||||
|
|
Loading…
Reference in New Issue