This commit includes a set of updates which:
* implement the new SessionsCache table
- The SessionsCache table can be used to track overall or game sepecific sessions
- The totalProfit field is summed by gameTypeId for cash games allowing for multiple currencies
- Tournament profit (cashes - buy-ins) are also recorded in totalProfit and its grouped by tourneyId
* change the sequence and methodology surrounding the import of hands
- fpdb_import.py implements a unique Hand.py method for each table
- Hands SessionCache and HudCache records themselves are 'cached' to allow for 'bulk insert' at EOF
- import is reorganized to allow for efficient locking in multiple connection environments
* changes the name of the index created by addTPlayersIndex (so that it is unique) to accommodate a bug in MySQL 5.5
TODO
* A 'rebuild_sessionsCache' method is still required
* Further commits are expected to fix bugs created during the porting of this code
This commit is contained in:
@@ -223,13 +223,18 @@ class SummaryImporter:
|
||||
print "Found %s summaries" %(len(summaryTexts))
|
||||
errors = 0
|
||||
imported = 0
|
||||
####Lock Placeholder####
|
||||
for j, summaryText in enumerate(summaryTexts, start=1):
|
||||
sc, gsc = {'bk': []}, {'bk': []}
|
||||
doinsert = len(summaryTexts)==j
|
||||
try:
|
||||
conv = obj(db=None, config=self.config, siteName=site, summaryText=summaryText, builtFrom = "IMAP")
|
||||
conv = obj(db=self.database, config=self.config, siteName=site, summaryText=summaryText, builtFrom = "IMAP")
|
||||
sc, gsc = conv.updateSessionsCache(sc, gsc, self.tz, doinsert)
|
||||
except FpdbParseError, e:
|
||||
errors += 1
|
||||
print _("Finished importing %s/%s tournament summaries") %(j, len(summaryTexts))
|
||||
imported = j
|
||||
####Lock Placeholder####
|
||||
return (imported - errors, errors)
|
||||
|
||||
def clearFileList(self):
|
||||
|
||||
Reference in New Issue
Block a user