Example #1
0
 def update_all_packages(cls):
     packages = cls.query.filter(
         or_(cls.last_check <= datetime.utcnow() - timedelta(days=1),
             cls.last_check == None)).all()
     for package in packages:
         with ignored(Exception):
             package.update_from_pypi()
             db.session.commit()
Example #2
0
 def send_emails(cls):
     users = cls.query.filter(
         or_(cls.email_sent_at <= datetime.utcnow() - timedelta(days=7),
             cls.email_sent_at == None)).all()
     for user in users:
         with ignored(Exception):
             logger.info(user)
             user.send_email()
             user.email_sent_at = datetime.utcnow()
             db.session.commit()
Example #3
0
 def update_all_packages(cls):
     packages = cls.query.filter(
         or_(
             cls.last_check <= datetime.utcnow() - timedelta(days=1),
             cls.last_check == None
         )
     ).all()
     for package in packages:
         with ignored(Exception):
             package.update_from_pypi()
             db.session.commit()
Example #4
0
 def send_emails(cls):
     users = cls.query.filter(
         or_(
             cls.email_sent_at <= datetime.utcnow() - timedelta(days=7),
             cls.email_sent_at == None
         )
     ).all()
     for user in users:
         with ignored(Exception):
             logger.info(user)
             user.send_email()
             user.email_sent_at = datetime.utcnow()
             db.session.commit()
Example #5
0
 def update_all_repos(cls):
     repos = cls.query.all()
     for repo in repos:
         with ignored(Exception):
             repo.update_requirements()
             db.session.commit()
Example #6
0
 def update_all_repos(cls):
     repos = cls.query.all()
     for repo in repos:
         with ignored(Exception):
             repo.update_requirements()
             db.session.commit()