Skip to content

Commit

Permalink
Revert two database changes
Browse files Browse the repository at this point in the history
- no more pool_size for create_engine
  It didn't work out of the box for SQLite. Moreover, there's a
  different solution that will be implemented soon.

- no more grouping by id in get_forts
  This made query return all fort sightings, instead of only the recent
  ones.
  • Loading branch information
modrzew committed Aug 10, 2016
1 parent 00b7b9a commit 622a4a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions db.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Team(enum.Enum):


def get_engine():
return create_engine(DB_ENGINE,pool_size=config.GRID[0]*config.GRID[1]+5)
return create_engine(DB_ENGINE)


def get_engine_name(session):
Expand Down Expand Up @@ -267,7 +267,7 @@ def get_forts(session):
FROM fort_sightings fs
JOIN forts f ON f.id=fs.fort_id
ORDER BY fs.last_modified DESC
) t GROUP BY fort_id, id
) t GROUP BY fort_id
''')
return query.fetchall()

Expand Down

0 comments on commit 622a4a9

Please sign in to comment.