Update submitModularHandler.pyx

This commit is contained in:
Josh Smith 2019-02-13 17:13:19 -05:00
parent 37730c1bb1
commit 1090d34d38

View File

@ -141,7 +141,10 @@ class handler(requestsManager.asyncRequestHandler):
# increment user playtime # increment user playtime
length = 0 length = 0
if s.passed: if s.passed:
try:
length = userUtils.getBeatmapTime(beatmapInfo.beatmapID) length = userUtils.getBeatmapTime(beatmapInfo.beatmapID)
except Exception:
log.error("Maxi's mirror must be down, as getBeatmapTime failed. L144 submitModular")
else: else:
length = math.ceil(int(self.get_argument("ft")) / 1000) length = math.ceil(int(self.get_argument("ft")) / 1000)
@ -230,7 +233,6 @@ class handler(requestsManager.asyncRequestHandler):
oldPersonalBestRank = 0 oldPersonalBestRank = 0
oldPersonalBest = None oldPersonalBest = None
# Save score in db # Save score in db
s.saveScoreInDB() s.saveScoreInDB()
@ -348,7 +350,6 @@ class handler(requestsManager.asyncRequestHandler):
oldUserData = glob.userStatsCache.get(userID, s.gameMode) oldUserData = glob.userStatsCache.get(userID, s.gameMode)
oldRank = userUtils.getGameRank(userID, s.gameMode) oldRank = userUtils.getGameRank(userID, s.gameMode)
# Always update users stats (total/ranked score, playcount, level, acc and pp) # Always update users stats (total/ranked score, playcount, level, acc and pp)
# even if not passed # even if not passed
@ -402,7 +403,6 @@ class handler(requestsManager.asyncRequestHandler):
if beatmapInfo is not None and beatmapInfo != False and s.passed: if beatmapInfo is not None and beatmapInfo != False and s.passed:
log.debug("Started building ranking panel.") log.debug("Started building ranking panel.")
if isRelaxing: # Relax if isRelaxing: # Relax
# Trigger bancho stats cache update # Trigger bancho stats cache update
glob.redis.publish("peppy:update_rxcached_stats", userID) glob.redis.publish("peppy:update_rxcached_stats", userID)
@ -498,6 +498,7 @@ class handler(requestsManager.asyncRequestHandler):
params = urlencode({"k": glob.conf.config["server"]["apikey"], "to": "#announce", "msg": annmsg}) params = urlencode({"k": glob.conf.config["server"]["apikey"], "to": "#announce", "msg": annmsg})
requests.get("{}/api/v1/fokabotMessage?{}".format(glob.conf.config["server"]["banchourl"], params)) requests.get("{}/api/v1/fokabotMessage?{}".format(glob.conf.config["server"]["banchourl"], params))
# Add the #1 to the database. Yes this is spaghetti.
scoreUtils.newFirst(s.scoreID, userID, s.fileMd5, s.gameMode, isRelaxing) scoreUtils.newFirst(s.scoreID, userID, s.fileMd5, s.gameMode, isRelaxing)
# Write message to client # Write message to client