Skip to content
This repository has been archived by the owner on Apr 18, 2018. It is now read-only.

Commit

Permalink
Change current push to mean the earliest of the open pushes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Latt committed Oct 28, 2010
1 parent 32d88e0 commit 032b432
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pushmaster/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def current_push():
current_push = memcache.get(CURRENT_PUSH_CACHE_KEY)
if current_push is None:
states = ('accepting', 'onstage')
current_push = model.Push.all().filter('state in', states).order('-ctime').get()
current_pushes = list(model.Push.all().filter('state in', states).order('-ctime'))
current_push = current_pushes[-1] if current_pushes else None
memcache.add(CURRENT_PUSH_CACHE_KEY, current_push or NO_CURRENT_PUSH, CACHE_SECONDS)
elif current_push == NO_CURRENT_PUSH:
return None
Expand Down

0 comments on commit 032b432

Please sign in to comment.