ghlister: add "catchup" action to continue from last time

This commit is contained in:
Stefano Zacchiroli 2015-04-29 11:05:28 +02:00
parent e564aa3fa5
commit 944d4a9c49
2 changed files with 28 additions and 0 deletions

View file

@ -12,6 +12,7 @@ import requests
import time
from pprint import pformat
from sqlalchemy import func
from ghlister.db_utils import session_scope
from ghlister.models import Repository
@ -89,6 +90,14 @@ def lookup_repo(db_session, repo_id):
.first()
def last_repo_id(db_session):
t = db_session.query(func.max(Repository.id)) \
.first()
if t is not None:
return t[0]
# else: return None
INJECT_KEYS = ['id', 'name', 'full_name', 'html_url', 'description', 'fork']