Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cleaned up db.window cruft.

(I don't really need this if I'm fronting with memcache)
  • Loading branch information...
commit 85ddc95a439dce40cfa62cc5261cd7f155caaf4e 1 parent f02f067
@jrconlin authored
Showing with 3 additions and 6 deletions.
  1. +3 −6 campaign/storage/sql.py
View
9 campaign/storage/sql.py
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.