Permalink
Browse files

Cleaned up db.window cruft.

(I don't really need this if I'm fronting with memcache)
  • Loading branch information...
1 parent f02f067 commit 85ddc95a439dce40cfa62cc5261cd7f155caaf4e @jrconlin committed Jan 31, 2013
Showing with 3 additions and 6 deletions.
  1. +3 −6 campaign/storage/sql.py
View
@@ -142,17 +142,14 @@ def get_announce(self, data, now=None):
# window. This is because the database won't cache a query if it
# differs from a previous one. The timestamp will cause the query to
# not be cached.
- window = int(self.settings.get('db.query_window', 1))
- if window == 0:
- window = 1
+ #window = int(self.settings.get('db.query_window', 1))
+ window = 1
if now is None:
now = int(time.time() / window) * window
sql = ("select created, id, note, priority, `specific`, "
"start_time, idle_time from %s where " % self.__tablename__ +
" coalesce(cast(start_time as unsigned), %s) <= %s"
- % (now - 1, now))
- #" and coalesce((cast(end_time / %s as unsigned) * %s), %s) > %s"
- #% (window, window, now + 1, now))
+ % (now - 1, now))
for field in ['product', 'platform', 'channel', 'lang', 'locale']:
if data.get(field):
sql += " and coalesce(%s, :%s) = :%s " % (field, field, field)

0 comments on commit 85ddc95

Please sign in to comment.