remove duplicate db calls which were slowing the hud down
This commit is contained in:
parent
4d45bd39d3
commit
ef2a8aca14
|
@ -245,10 +245,6 @@ class HUD_main(object):
|
||||||
,self.hero_ids[site_id], num_seats)
|
,self.hero_ids[site_id], num_seats)
|
||||||
t3 = time.time()
|
t3 = time.time()
|
||||||
try:
|
try:
|
||||||
self.db_connection.init_hud_stat_vars( self.hud_dict[temp_key].hud_params['hud_days']
|
|
||||||
, self.hud_dict[temp_key].hud_params['h_hud_days'])
|
|
||||||
t4 = time.time()
|
|
||||||
stat_dict = self.db_connection.get_stats_from_hand(new_hand_id, type, self.hud_dict[temp_key].hud_params, self.hero_ids[site_id])
|
|
||||||
self.hud_dict[temp_key].stat_dict = stat_dict
|
self.hud_dict[temp_key].stat_dict = stat_dict
|
||||||
except KeyError: # HUD instance has been killed off, key is stale
|
except KeyError: # HUD instance has been killed off, key is stale
|
||||||
sys.stderr.write('hud_dict[%s] was not found\n' % temp_key)
|
sys.stderr.write('hud_dict[%s] was not found\n' % temp_key)
|
||||||
|
@ -256,9 +252,10 @@ class HUD_main(object):
|
||||||
# Unlocks table, copied from end of function
|
# Unlocks table, copied from end of function
|
||||||
self.db_connection.connection.rollback()
|
self.db_connection.connection.rollback()
|
||||||
return
|
return
|
||||||
t5 = time.time()
|
|
||||||
cards = self.db_connection.get_cards(new_hand_id)
|
cards = self.db_connection.get_cards(new_hand_id)
|
||||||
|
t4 = time.time()
|
||||||
comm_cards = self.db_connection.get_common_cards(new_hand_id)
|
comm_cards = self.db_connection.get_common_cards(new_hand_id)
|
||||||
|
t5 = time.time()
|
||||||
if comm_cards != {}: # stud!
|
if comm_cards != {}: # stud!
|
||||||
cards['common'] = comm_cards['common']
|
cards['common'] = comm_cards['common']
|
||||||
self.hud_dict[temp_key].cards = cards
|
self.hud_dict[temp_key].cards = cards
|
||||||
|
|
Loading…
Reference in New Issue
Block a user